txt file writing

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

txt file writing

Post by wwei23 » July 16th, 2017, 2:57 pm

How do I get Python to write to a txt file?

Sokwe
Moderator
Posts: 2679
Joined: July 9th, 2009, 2:44 pm

Re: txt file writing

Post by Sokwe » July 16th, 2017, 3:21 pm

Try googling "How do I get Python to write to a txt file?"
-Matthias Merzenich

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: txt file writing

Post by Saka » July 16th, 2017, 7:30 pm

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

If I remember correctly

drc
Posts: 1664
Joined: December 3rd, 2015, 4:11 pm

Re: txt file writing

Post by drc » July 16th, 2017, 8:14 pm

Saka wrote:Uvuvwevwevwe
Wow that's a really obscure reference(?), nice job.

User avatar
dvgrn
Moderator
Posts: 10669
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: txt file writing

Post by dvgrn » July 16th, 2017, 9:56 pm

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: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: txt file writing

Post by Saka » July 17th, 2017, 5:02 am

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.

Naszvadi
Posts: 1248
Joined: May 7th, 2016, 8:53 am
Contact:

Re: txt file writing

Post by Naszvadi » July 17th, 2017, 6:54 am

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

Post Reply