Re: Read a file with open command

2006-08-12 Thread John Machin
[EMAIL PROTECTED] wrote: [snip] > My point is that this is a wonderful service you tutors provide, but > the Zappa signature may not be the best choice for this setting. This is *not* the tutor list. >Most people will read it and get a laugh (as did I), but how many have taken > it the way jean-j

Re: Read a file with open command

2006-08-12 Thread AlbaClause
[EMAIL PROTECTED] wrote: > AlbaClause wrote: >> jean-jeanot wrote: >> > > >> Ummm, he did not say that your question was stupid. The Zappa quote is >> included as part of what we refer to as a 'signature'. In the case of >> Sybren Stuvel's posts to this newsgroup, the Frank Zappa quote is >>

Re: Read a file with open command

2006-08-12 Thread gslindstrom
AlbaClause wrote: > jean-jeanot wrote: > > Ummm, he did not say that your question was stupid. The Zappa quote is > included as part of what we refer to as a 'signature'. In the case of > Sybren Stuvel's posts to this newsgroup, the Frank Zappa quote is included > in every message that he pos

Re: Read a file with open command

2006-08-11 Thread jean-jeanot
Sorry, I regret my reaction. Jean-jeanot AlbaClause a écrit : > jean-jeanot wrote: > > > Dear Sybrel, > > > > I am delighted to know that you have been enlighted through my > > question. > > I am aware of my stupidity and I would say of my ignorance.If all > > Python users were not ignorant I s

Re: Read a file with open command

2006-08-11 Thread AlbaClause
jean-jeanot wrote: > Dear Sybrel, > > I am delighted to know that you have been enlighted through my > question. > I am aware of my stupidity and I would say of my ignorance.If all > Python users were not ignorant I suppose the Python group would be > superfluous. I would suggest that if if you

Re: Read a file with open command

2006-08-11 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jean-jeanot wrote: > Sorry, but the access mode is not binary with XP Windows. But ods files are binary so you better open them as binary files. Windows does a "magical" translation of line ending bytes and stops processing a file if it hits a \x26 byte if the file was op

Re: Read a file with open command

2006-08-11 Thread jean-jeanot
Dear Sybrel, I am delighted to know that you have been enlighted through my question. I am aware of my stupidity and I would say of my ignorance.If all Python users were not ignorant I suppose the Python group would be superfluous. I would suggest that if if you think that a question is supid ple

Re: Read a file with open command

2006-08-11 Thread Tim Williams
On 11 Aug 2006 09:39:23 -0700, jean-jeanot <[EMAIL PROTECTED]> wrote: > Anyway many thanks.Here is the program: > > >>> file_obj= open ("D:/Mes documents/ADB Anna.ods",'r') > >>> s = file_obj > >>> s.readlines() Please remember not to top-post :) Try this >>> s = open ("D:/Mes documents/ADB Ann

Re: Read a file with open command

2006-08-11 Thread jean-jeanot
Sorry, but the access mode is not binary with XP Windows. Finally for reading the file it is necessary to use a slash or a double backslash. If the file is a simple textfile, using a backslash is perhaps not recommended but it is functionning. Anyway many thanks.Here is the program: >>> file_obj=

Re: Read a file with open command

2006-08-11 Thread John Machin
jean-jeanot wrote: > I can access to a file with the command: > file_obj = open ( " D:\My documents\Textfile.txt",'r') With a space before the drive letter? I don't think so. When asking questions, *don't* type what you thought you used, copy/paste what you actually used. > > When I now try to re

Re: Read a file with open command

2006-08-11 Thread Jan Svec
Hi, simply use file_obj = open ("D:\My documents\File.ods",'rb') for opening file in binary access mode, which is required for binary files on MS Windows. Honza jean-jeanot wrote: > I can access to a file with the command: > file_obj = open ( " D:\My documents\Textfile.txt",'r') > > When I now try