IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> python and mac issues
chand   
Jul 29 2010, 07:37 AM    Post #1
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.


 
Go to the top of the page +
poiuy_qwert    Canada
Jul 29 2010, 07:43 AM    Post #2
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 "/".


 
Go to the top of the page +
chand   
Jul 29 2010, 08:02 AM    Post #3
Thanks so much. It worked !


 
Go to the top of the page +
poiuy_qwert    Canada
Jul 29 2010, 09:45 AM    Post #4
No problem.


 
Go to the top of the page +

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 7th September 2010 - 06:09 PM