| Reply | « Previous Thread | Next Thread » |
|
How to import a variable from a custom module?
|
| DrivingMobileInnovation |
| View Public Profile |
| Find all posts by DrivingMobileInnovation |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
Let's assume you have a custom module named mymodule, with the variable x in it. All you have to do is import the module and make reference to the variable in it:
Code:
import mymodule new_variable=mymodule.x |
|
Still it is possible
Code:
from mymodule import x Code:
from mymodule import x as new_variable |
|
Thank you. By the way what do you think of that?
main.py Code:
import mymodule, appuifw a = mymodule.askword() print a Code:
import appuifw
def askword():
d = appuifw.query(u"Write", "text")
return d
Last edited by DrivingMobileInnovation : 2008-06-30 at 20:14.
|
| DrivingMobileInnovation |
| View Public Profile |
| Find all posts by DrivingMobileInnovation |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi DrivingMobileInnovation
thats absolutely perfect. ![]() Moreover i have written a wiki article on this have a look. Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60
Last edited by gaba88 : 2008-07-01 at 05:05.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| How to import a custom module? | 9600baud | Python | 8 | 2008-06-25 16:37 |
| Error import module | akus | Python | 0 | 2007-10-21 20:47 |
| problem on running my application | rsf | Python | 7 | 2007-10-21 16:56 |
| Carbide.j 1.5 and Netbeans 5.5 beta 2 | ovjo12 | Mobile Java Tools & SDKs | 5 | 2007-06-11 06:43 |
| GoogleIt | deepika.mangla | General Symbian C++ | 4 | 2007-01-08 02:07 |