Russ Suter
asked on
New to Python, how do I import?
I have a Python module which I have called "helpers.py".
Now I have another Python module I have called "_test.py"
import clr
clr.AddReference('System.Windows.Forms')
import System.Windows.Forms as SWF
def hello_world(name):
return "Hello %s!" % (name)
def main(cmd):
SWF.MessageBox.Show(hello_world("Fred"))
return
Nice and simple and I can call it and it works.Now I have another Python module I have called "_test.py"
import helpers
import clr
clr.AddReference('System.Windows.Forms')
import System.Windows.Forms as SWF
def main(cmd):
SWF.MessageBox.Show(hello_world("Ethel"))
return
Obviously I'm doing the import wrong because I get an error saying "No module named helpers". Both .py files are in the same directory. How do I correct my mistake?
ASKER
Nope, same error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Independent research and trial and error yielded a working solution. No working solution was provided above.
Open in new window