On 1/16/07, altern
Tom Lieber wrote:
When I try
import osc osc.init()
from the Python console in Windows, it works. When I put it in a file then run "python mine.py" it fails with the message that "init" is not defined. What could the difference be?
thats weird, did you put the osc module (the osc folder) in the right place? (c:\Python2.X\Lib\site-packages)
do you trigger "python mine.py" from command line in the windows terminal? and the python console you mean the interactive python shortcut from the python menu? It could be that you have two different versions on python installed but this should not be a problem on windows as far as i remember.
otherwise try doing print dir(osc) in both the python console and the mine.py, just after importing osc module before the osc.init(). The init function should be listed in the dictionary you get printed into the output window.
beware that there is an OSC.py file inside the osc module. you might have copied only the OSC.py file and not the osc folder with all the files included?
another option is that you have another module called osc and there is a naming conflict. Or maybe there is a folder called osc inside the folder where the mine.py is located? try to move the mine.py file somewhere else.
Thanks, I had an osc.py in the same directory!
let me know if you get it working
enrike
Sincerely, Tom Lieber http://AllTom.com/ http://GadgetLife.org/