Hi,
recently I was informed that my most recent project is not running
properly in Vista. I'm using the skellington structure suggested by
Pyweek administration and I'm wondering if that's somehow related.
File structure for the project (as far as it is relevant to this post):
ssof/run_game.py
ssof/lib/main.py
run_game.py's contents:
____________________
#! /usr/bin/env python
import sys
import os
try:
__file__
except NameError:
pass
else:
libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))
sys.path.insert(0, libdir)
import main
main.main()
_______________
User feedback:
Alright then,
Open fully-updated Windows Vista. Open IDLE. Python version number is
2.5.2. Open run_game.py. Hit F5 (runs the script).
Traceback (most recent call last):
File "C:\Users\Andy
Hanson\Desktop\ssof-2009-01-31-fixed\ssof_alpha4\run_game.py", line
15, in <module>
import main
ImportError: No module named main
This is certainly a very simple problem!
________________
Any thoughts? What am I doing wrong here?
(I'm attaching run_game.py just in case the formatting gets messed up)
-Thiago
#! /usr/bin/env python
import sys
import os
try:
__file__
except NameError:
pass
else:
libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))
sys.path.insert(0, libdir)
import main
main.main()