How to import a variable from a module

The two line code below shows how to import a variable from a module.
Method 1:

import mymodule
 
new_variable=mymodule.x
Method 2:

from mymodule import x
or
from mymodule import x as new_variable



Thank you for reading this post. You can now Leave A Comment (0) or Leave A Trackback.

Post Info

This entry was posted on Wednesday, July 2nd, 2008 and is filed under Blogroll.

You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.



Previous Post: Groups seek drilling halt near sage grouse habitat »
Next Post: Google wins source code ruling against Viacom »

Read More

Related Reading:



Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.

You must be logged in to post a comment.

edwan