Where to put python modules?

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
Saka
Posts: 3587
Joined: June 19th, 2015, 8:50 pm
Location: somewhere
Contact:

Where to put python modules?

Post by Saka » November 28th, 2016, 4:43 am

I'm creating a module called "LifePlus" but I'm not sure where to put it. Do I put it in the scripts folder?

Code: Select all

o3b2ob2obo3b2o2b2o$bo3b2obob3o3bo2bo$2bo2b3o5b3ob4o$3o3bo2bo2b3o3b3o$
4bo4bobo4bo$2o2b2o2b4obo2bo3bo$2ob4o3bo2bo2bo2bo$b2o3bobob2o$3bobobo5b
obobobo$3bobobob2o3bo2bobo!
(Check gen 3)
Add your computer to the Table of Lifeenthusiast Computers!

User avatar
Andrew
Moderator
Posts: 803
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Where to put python modules?

Post by Andrew » November 28th, 2016, 5:37 am

Saka wrote:I'm creating a module called "LifePlus" but I'm not sure where to put it. Do I put it in the scripts folder?
No -- you definitely should NOT store any of your own scripts/patterns/rules/whatever in the folders supplied with Golly. If you follow the folder structure recommended in Help > Hints and Tips then all your scripts should be in a separate folder called My-scripts (or any other name you prefer). If you put your LifePlus module in that folder then all your Python scripts can use it by doing "import LifePlus".

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

Re: Where to put python modules?

Post by Saka » November 28th, 2016, 5:58 am

So basically I should put it together with all my other scripts? (In the same folder?)

Code: Select all

o3b2ob2obo3b2o2b2o$bo3b2obob3o3bo2bo$2bo2b3o5b3ob4o$3o3bo2bo2b3o3b3o$
4bo4bobo4bo$2o2b2o2b4obo2bo3bo$2ob4o3bo2bo2bo2bo$b2o3bobob2o$3bobobo5b
obobobo$3bobobob2o3bo2bobo!
(Check gen 3)
Add your computer to the Table of Lifeenthusiast Computers!

User avatar
Andrew
Moderator
Posts: 803
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Where to put python modules?

Post by Andrew » November 28th, 2016, 8:37 am

Saka wrote:So basically I should put it together with all my other scripts? (In the same folder?)
Yes.

Post Reply