Just wanted to add:
1) using absolute locations is usually less prone to error, because the
current directory can be changed without you knowing it.
2) On Windows, either use "c:/foo/bar" or "c:\\foo\\bar", or
r"c:\foo\bar" (not the 'r' in front).
- Almar
On 22-06-15 09:04, Ludo Visser wrote:
> If you run the file as a script (from the “Run” menu), the shell should
> change the current directory to the directory of the .py file that is
> being executed.
>
> - Ludo
>
>> Op 22 jun. 2015, om 04:45 heeft
vweb.we...@gmail.com
>> <mailto:
vweb.we...@gmail.com> het volgende geschreven:
>>
>> I'm using tkinter with the default python shell (2.7).
>>
>> When I try to load images, like a window icon or PhotoImage, it does
>> not locate the image files.
>>
>> All I want the program to do is load images from the folder where the
>> .py file is located. Can anyone explain how to get IEP to do that?
>>
>> I see a startDir setting in the Shell configuration, but I don't know
>> what to put in there. I don't want to set it to a specific folder. I
>> just always want it to load images from the same folder the .py file
>> is located in.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Interactive Editor for Python" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to
iep_+uns...@googlegroups.com
>> <mailto:
iep_+uns...@googlegroups.com>.
> --
> You received this message because you are subscribed to the Google
> Groups "Interactive Editor for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
iep_+uns...@googlegroups.com
> <mailto:
iep_+uns...@googlegroups.com>.