I have a module "B", I want to run it from a script "C", and I want to call global variables in "B", as they were in the "C" root. Another problem is if I imported
sys in "B" when I run "C" it doesn't see
# NameError: global name 'sys' is not defined #
What shall I do?
Function parameter types in Python
Best/Fastest Way to Test Python CGI locally?
import B), every line in
Bwill be interpreted.
Simple way to encode a string according to a password?
I assume this is what you mean when you say you want to run it.
Enforce “spaces” or “tabs” only in python files?
To reference members in
B's namespace, you can get them like:.
How to rename a file using Python
Access Delicious API via Yahoo ID without redirect to Yahoo authorizing page
If you wish to use
C, you will need to import it within
OpenType with Python [closed]
Renaming a pylons controller
then, in module C.
import os, sys sys.path.append('/PATH/TO/MODULE/B')
from B import * something_defined_in_B()