Re: Tkinter PhotoImage, no such file or directory

Gonzalo Monzón <[email protected]>
Newsgroups gmane.comp.python.windows-ce
Message-ID <[email protected]>
Patrick Kramer escribió:

><quote who="Luke Dunstan">
>  
>
>>You can tell Python using os.chdir(), but that will not necessarily have any
>>effect on Tkinter because the operating system has no concept of a "current
>>directory", so it depends on whether the image file is opened in the Python
>>code or the C code.
>>
>>Luke
>>
>>    
>>
>
>So there is no way for python to return the current directory it is in?
>
>say something like:
>
>dir = return_dir()
>
>image_loc = dir + "//BtnGluco.gif"
>
>Or:
>
>image_loc = dir + "//assets//img//BtnGluco.gif" #This is how I would like to orgnize it
>_______________________________________________
>PythonCE mailing list
>[email protected]
>http://mail.python.org/mailman/listinfo/pythonce
>
>  
>
Hi,

I use this:

if (OS == "ce"):
   path = sys.path[0]           
else:
   path = os.curdir


It works right for me.

Gonzalo Monzón.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.