Title: Signature.html
Thanks. A file name! That's funny. Bitten by my early acquaintance a few weeks ago with TkFileDialog, when I innocently stuck the method in the function to come back to. Wrong method! I don't think I'll forget next time. :-)

Yes, I agree with wanting to open and close the file oneself. 

The fact that there's a ton of such documentation on file is the problem. Using Google to find the "right" one is like playing a slot machine.  Similarly enumerate.

The link you gave to enumerate doesn't quite do it for my example.
for (line_cnt, each_line) ... I no longer have any idea what that means. Ah, by Googling with "for (line_cnt, each_line)", I've found some direct help, and the source of help on it--Python Tutor, Feb 13-14,2008. Someone responded to a question I posted on it, but there was no explanation. I just used it, and it worked. I may be the only one in the history of computing to ask about it. :-)

Thanks to your use of the word pillow it's not likely I will be able to find the link to  the Library Reference more easily, strange as that may seem. It is now bookmarked, as it has been, but with the word pillow in the title.

My browser's bookmark capabilities have put me in the corner of disorganization, Mozilla Seamonkey. I easily have 1000 bookmarks and probably 40 or more on python.  It an its predecessors have what I consider poor mgmt tools for bmrks. To make sure I even have a chance at finding my python bkmrks, I've put python in the title to make sure I have a fighting chance with their search to find them. One cannot even do a search on "python" and then do a "Move To" to put them in a single folder. I might as well roll dice.

This may change. I'm about to install Firefox.

Alan Gauld wrote:

"Wayne Watson" <sierra_mtnv...@sbcglobal.net> wrote

Three questions about askopenfilename and enumerate.

For askopenfilename:
1. Do I have to close the file before exiting from it?
2. How do I read each line of text in the file and quit when an eof is reached?

This has nothing to do with askopenfilename!

....
3. Where can I find out more about enumerate, as used here:

 input_file=open('Initial.sen','r')
 for (line_cnt, each_line) in enumerate(input_file):

In the python documentation - try the search box on
the python site or just google for python enumerate.
The latter took me on the third link to:

http://python.active-venture.com/whatsnew/section-enumerate.html

Which is probably the simplest and shortest explanayin you will get!

Documentation for enumerate seems scarce.

BTW, is there a thorough document on the use of files in Python
out there somewhere?

There is a ton of it and every tutorial (including mine) will have
a section on handling files. The official tutorial has a fair bit on
it and the reference manual has a whole section.

A good place to start might be the Library Reference (the one
they suggest keeping under your pillow!)

http://docs.python.org/library/stdtypes.html#file-objects

HTH,


--
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
            
            Shhhh, quiet. I'm thinking about filling this space. 


                    Web Page: <www.speckledwithstars.net/>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to