[Chicago] Got it Re: opening a file for read in 3.2

Randall Baxley rlbax777 at swbell.net
Thu Nov 1 19:35:06 CET 2012


Thank you,
In the lectures they hard coded the file name and path for input and used tkinter.filedialog.askopenfilename() for output but since that brought up finder I suspected that was not a good idea for a windows machine and I did not know the equivalent import and call in windows.
I am concentrating on learning the language syntax first for at least the next two weeks when I will begin to try and catch up in the Rice class after finishing the U of Toronto class.
Randy

--- On Thu, 11/1/12, sheila miguez <shekay at pobox.com> wrote:

From: sheila miguez <shekay at pobox.com>
Subject: Re: [Chicago] Got it Re: opening a file for read in 3.2
To: "The Chicago Python Users Group" <chicago at python.org>
Date: Thursday, November 1, 2012, 12:11 PM


I'm glad you figured it out. I didn't want to reply to the original question because I didn't have a windows computer to test out my answers on thus could not be sure I'd give you a correct answer.



Anyway, another thing to think about, for the future, is that path delimiters are different on different operating systems. I don't know if the class covered that or not, but check it out at some point in case you want to write scripts that can work on different OSs. So instead of using literal strings where you hard code the path separator, '/', do it programmatically.



http://docs.python.org/2/library/os.path.html


-- 
sheila



-----Inline Attachment Follows-----

_______________________________________________
Chicago mailing list
Chicago at python.org
http://mail.python.org/mailman/listinfo/chicago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20121101/089a4097/attachment.html>


More information about the Chicago mailing list