Trouble with IDLE in Windows

vincent wehren v.wehren at home.nl
Sun Feb 2 02:31:27 EST 2003


"Rob Renaud" <rpgnmets at aol.com> schrieb im Newsbeitrag
news:3759308d.0302012211.753c990f at posting.google.com...
> I am trying to port (ensure it works, hopefully produce a binary with
> py2exe) a python program I wrote in Linux to Windows.  When I run the
> python file that includes the main program from IDLE (Ctrl + F5),
> python barfs saying it cannot import a file in the same directory as
> the main source file.
>
> How can I fix this?  Is it possibly related to not having an
> __init__.py file?

Make sure that you start IDLE from within the directory your main file
resides in (you can try right-clicking > Edit with IDLE), effectively making
it your working directory, or add that directory to sys.path (e.g. by adding
sys.path.append(".") to your main file).

Kind regards,
Vincent Wehren










More information about the Python-list mailing list