[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Re: Python path problem in vista?



I get that error if I run from IDLE... But if I run it any other way
there is no problem.  IDLE is screwing up the __file__.  Don't know
why IDLE thinks it's OK to do that, but there it is.

On Tue, Feb 10, 2009 at 2:48 AM, Thiago Chaves <shundread@xxxxxxxxx> wrote:
> Can anyone in the list also reply if they do NOT get problems running
> programs with skellington-compliant structure on Vista? So far I've
> got only one person informing of problems executing the program and
> I'd like to hear if that's widespread or not.
>
> -Thiago
>
> On Sun, Feb 8, 2009 at 10:02 PM, Thiago Chaves <shundread@xxxxxxxxx> wrote:
>> 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
>>
>