Re: line wrapping problem

2006-02-09 Thread Kent Johnson
S Borg wrote: > Hello, > > I am parsing text from one document to another. I have a scheme > similar to: > > for x in myfoobar: >print >> mytextfile, "%s" % mydictionary[x], #all on same line > print >> mytextfile, '\n' #new line > > > I am getting line breaks before my explic

Re: line wrapping problem

2006-02-09 Thread Juho Schultz
ZeD wrote: > Ciao, Juho Schultz! Che stavi dicendo? > Moro, ZeD! Kunhan pulisen. Should we stick to English? > >>should work. IMO file.write() is self-explanatory but "print >> file" is >>a bit obscure. > > is obscure only if you have never used a shell :) > (I have used the shell a bit. I star

Re: line wrapping problem

2006-02-09 Thread Peter Otten
S Borg wrote: > I am parsing text from one document to another. I have a scheme > similar to: > > for x in myfoobar: >print >> mytextfile, "%s" % mydictionary[x], #all on same line print >> mytextfile # minimal fix > I am getting line breaks before my explicit line break. Am

Re: line wrapping problem

2006-02-09 Thread ZeD
Ciao, Juho Schultz! Che stavi dicendo? > should work. IMO file.write() is self-explanatory but "print >> file" is > a bit obscure. is obscure only if you have never used a shell :) -- Evangelion e' la storia yaoi di un angelo che vuole portarsi a letto un ragazzo che si intreccia con la storia

Re: line wrapping problem

2006-02-09 Thread John Zenger
S Borg wrote: > print >> mytextfile, '\n' #new line Wouldn't this print two line breaks--the one you specify in the string, plus the one always added by print if there is no comma at the end of the statement? -- http://mail.python.org/mailman/listinfo/python-list

Re: line wrapping problem

2006-02-09 Thread Juho Schultz
S Borg wrote: > Hello, > > I am parsing text from one document to another. I have a scheme > similar to: > > for x in myfoobar: >print >> mytextfile, "%s" % mydictionary[x], #all on same line > print >> mytextfile, '\n' #new line > > > I am getting line breaks before my explic

Re: line wrapping problem

2006-02-09 Thread Fuzzyman
S Borg wrote: > Hello, > > I am parsing text from one document to another. I have a scheme > similar to: > > for x in myfoobar: >print >> mytextfile, "%s" % mydictionary[x], #all on same line > print >> mytextfile, '\n' #new line > You are using the print command to output the t