txt file writing

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
wwei23
Posts: 949
Joined: May 22nd, 2017, 6:14 pm
Location: The (Life?) Universe

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: 1625
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

Saka
Posts: 3138
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

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
Airy Clave White It Nay

Code: Select all

x = 17, y = 10, rule = B3/S23
b2ob2obo5b2o$11b4obo$2bob3o2bo2b3o$bo3b2o4b2o$o2bo2bob2o3b4o$bob2obo5b
o2b2o$2b2o4bobo2b3o$bo3b5ob2obobo$2bo5bob2o$4bob2o2bobobo!
(Check gen 2)

User avatar
drc
Posts: 1664
Joined: December 3rd, 2015, 4:11 pm
Location: creating useless things in OCA

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.
\100\97\110\105

User avatar
dvgrn
Moderator
Posts: 6277
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.

Saka
Posts: 3138
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

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.
Airy Clave White It Nay

Code: Select all

x = 17, y = 10, rule = B3/S23
b2ob2obo5b2o$11b4obo$2bob3o2bo2b3o$bo3b2o4b2o$o2bo2bob2o3b4o$bob2obo5b
o2b2o$2b2o4bobo2b3o$bo3b5ob2obobo$2bo5bob2o$4bob2o2bobobo!
(Check gen 2)

Naszvadi
Posts: 422
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