txt file writing

For scripts to aid with computation or simulation in cellular automata.
Post Reply
wwei23

txt file writing

Post by wwei23 »

How do I get Python to write to a txt file?
Sokwe
Moderator
Posts: 3401
Joined: July 9th, 2009, 2:44 pm

Re: txt file writing

Post by Sokwe »

Try googling "How do I get Python to write to a txt file?"
-Matthias Merzenich
User avatar
Saka
Posts: 3626
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: txt file writing

Post by Saka »

F = open("Blah.txt","w")
F.write("Uvuvwevwevwe")

If I remember correctly
jarring cyan
drc
Posts: 1664
Joined: December 3rd, 2015, 4:11 pm

Re: txt file writing

Post by drc »

Saka wrote:Uvuvwevwevwe
Wow that's a really obscure reference(?), nice job.
User avatar
dvgrn
Moderator
Posts: 12047
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: txt file writing

Post by dvgrn »

Golly's shift.py/lua and goto.py/lua both remember previously used numbers by reading and writing to specific text files in Golly's data folder. Just right-click on those scripts for a reminder of how the syntax works.
User avatar
Saka
Posts: 3626
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: txt file writing

Post by Saka »

drc wrote:
Saka wrote:Uvuvwevwevwe
Wow that's a really obscure reference(?), nice job.
When I look for a text spacefiller I always get what comes out fresh from the lump of dead stuff that makes me living.
jarring cyan
Naszvadi
Posts: 1476
Joined: May 7th, 2016, 8:53 am
Contact:

Re: txt file writing

Post by Naszvadi »

This topic is a candidate for being moved to ../forums/viewforum.php?f=12 a.k.a. Sandbox.
Post Reply