Mailing List Archive

Writing lines longer than 80 charc !
I'm wondering if someone knew of a way of writing a line of more than 80
characters
to a file in way that it won't split it into two lines.

thanks
Sunit
sjoshi@ingr.com
Writing lines longer than 80 charc ! [ In reply to ]
Sunit asks:

> I'm wondering if someone knew of a way of writing a line of more
> than 80 characters to a file in way that it won't split it into two
> lines.

That's an artifact of the way you're viewing it. None of the ways of
writing characters to a file do anything special at 80 characters.

>>> open('test.txt','w').write('a'*1024)
>>> txt = open('test.txt', 'r').read()
>>> len(txt)
1024
>>> txt == 'a'*1024
1

See? Nothing but 'a's.

- Gordon
Writing lines longer than 80 charc ! [ In reply to ]
In article <e6iPAsIg#GA.226@upnetnews03>, SunitJoshi
<SunitJoshi@email.msn.com> wrote:

> I'm wondering if someone knew of a way of writing a line of more than 80
> characters to a file in way that it won't split it into two lines.

Well, you could type the line in BBEdit Lite, then use the "Save"
command...

I assume you don't mean writing a line to a file in Python, because it
doesn't split it into two lines. Maybe you think it does because of
the way you're viewing it?

For a more detailed answer, try posting a more detailed question.

Cheers,
-- Joe

--
,------------------------------------------------------------------.
| Joseph J. Strout Biocomputing -- The Salk Institute |
| joe@strout.net http://www.strout.net |
`------------------------------------------------------------------'
Check out the Mac Web Directory! http://www.strout.net/macweb.cgi