ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

txt file writing

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

txt file writing

Postby wwei23 » July 16th, 2017, 2:57 pm

How do I get Python to write to a txt file?
Replicator!
x = 3, y = 3, rule = B3/S234y
2bo$3o$bo!
wwei23
 
Posts: 234
Joined: May 22nd, 2017, 6:14 pm
Location: The (Life?) Universe

Re: txt file writing

Postby Sokwe » July 16th, 2017, 3:21 pm

Try googling "How do I get Python to write to a txt file?"
-Matthias Merzenich
Sokwe
Moderator
 
Posts: 1089
Joined: July 9th, 2009, 2:44 pm

Re: txt file writing

Postby Saka » July 16th, 2017, 7:30 pm

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

If I remember correctly
Nice waterbear you got there. Would be a shame if this rake shot it down from the other side of the universe.
User avatar
Saka
 
Posts: 1523
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: txt file writing

Postby drc » July 16th, 2017, 8:14 pm

Saka wrote:Uvuvwevwevwe


Wow that's a really obscure reference(?), nice job.
This post was brought to you by the letter D, for dishes that Andrew J. Wade won't do. (Also Daniel, which happens to be me.)

B2-ac3i4a/S12
User avatar
drc
 
Posts: 1344
Joined: December 3rd, 2015, 4:11 pm
Location: creating useless things in OCA

Re: txt file writing

Postby 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.
dvgrn
Moderator
 
Posts: 3700
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: txt file writing

Postby 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.
Nice waterbear you got there. Would be a shame if this rake shot it down from the other side of the universe.
User avatar
Saka
 
Posts: 1523
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: txt file writing

Postby 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.
Naszvadi
 
Posts: 133
Joined: May 7th, 2016, 8:53 am


Return to Scripts

Who is online

Users browsing this forum: No registered users and 1 guest