Title: accessing my modules from within Python
I'm just starting to learn Python. When I write a module in one of my text programs (MSWord, or Textedit) and save it as a text file in on my harddrive, and then go to the terminal window to import it, I get a message saying it either can't find the file or can't open it. I do put the .py suffix on when I save the module, but no success. I have been saving my modules in different places, the last of which was in library/python/2.3/sitepackages ... no success. The test module I’ve written is called bogus.py

If I start python in the terminal window and then type 'import bogus' I get a message saying 'Import error: No module named bogus'

If I try and launch the python module by typing 'python bogus.py' I get a message "python: can't open file 'bogus.py' "

Question: Can I use TextEdit or MS Word to write modules just so long as I put a .py suffix on the file?

Question: How can I save a module such that Python can find and open it?
_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to