How to use a variable form main script in a module.
Lars Marius Garshol
larsga at ifi.uio.no
Mon Jul 26 10:35:21 EDT 1999
More information about the Python-list mailing list
Mon Jul 26 10:35:21 EDT 1999
- Previous message (by thread): How to use a variable form main script in a module.
- Next message (by thread): How to use a variable form main script in a module.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
* Peter Torstenson | | This is probaly a silly question from a newbie. | In my main script I put a value for to a variable called "x". | Now I want to use the "x" variable in a module. | The module is imported into the main script. How to do this? >From the way you describe it this sounds like something you shouldn't do. Communication between different pieces of code through globabl variables is in general frowned upon, and with good reason. It's good for some things, but for those the variables tend to reside in a module, and not in the global namespace. Feel free to explain the reason why you want this if you want a verdict on whether it's a good or bad idea. [...wrong info in previous version of this post removed (global doesn't work)...] --Lars M.
- Previous message (by thread): How to use a variable form main script in a module.
- Next message (by thread): How to use a variable form main script in a module.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list