python and mac issues

Help - Resources - Discussion
bubli1
Posts: 2
Joined: Thu Jul 29, 2010 3:18 pm

python and mac issues

Postby bubli1 » Thu Jul 29, 2010 3:37 pm

Hi,
I'm trying to run a python program on Mac.It was originally written on Windows environment. Everytime I try to run it from Mac, I get the following error :
Traceback (most recent call last):
File "/Users/Chandrima/MSD4.py", line 149, in <module>
ifile = tkFileDialog.askopenfilename(title="Select File with X Y Gauss Fit",filetypes=[('Text file','*FULL.txt'),('Text file','*.txt'),('All','*')],initialdir="C:")
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/tkFileDialog.py", line 125, in askopenfilename
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/tkCommonDialog.py", line 48, in show
TclError: bad directory "C:"

Any help to solve this problem will be greatly appreciated.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Thu Jul 29, 2010 3:43 pm

The error message says it all:
TclError: bad directory "C:"

Your call to tkFileDialog.askopenfilename has the initialdir set to "C:", which is not valid on a Mac. I'm actually not 100% certain on the Mac equivelant, but im pretty sure you want to use just "/".
bubli1
Posts: 2
Joined: Thu Jul 29, 2010 3:18 pm

Postby bubli1 » Thu Jul 29, 2010 4:02 pm

Thanks so much. It worked !
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Thu Jul 29, 2010 5:45 pm

No problem.

Return to “PyMS (poiuy_qwert's complete modding suite)”

Who is online

Users browsing this forum: No registered users and 1 guest