Running Scripts on Bgolly

For scripts to aid with computation or simulation in cellular automata.
Post Reply
Rocknlol
Posts: 125
Joined: April 15th, 2012, 9:06 am

Running Scripts on Bgolly

Post by Rocknlol » June 15th, 2015, 11:57 pm

I'm trying to run a script on bgolly (specifically apgsearch) but I'm having trouble figuring out how to do so. The only argument that mentions scripts when I run bgolly is --exec and no matter where I seem to put the script file or what I name I'm always given "Cannot open testscript".

What specific command do I need to run the script, and what directory does it need to be in? Or is running scripts just not possible in bgolly?

User avatar
biggiemac
Posts: 515
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Running Scripts on Bgolly

Post by biggiemac » June 16th, 2015, 9:23 pm

From the time I have spent trying to get this to work I have gathered running scripts isn't possible in bgolly. That and outdated graphics libraries blocking golly prevented me from logging on to my school's linux server and running apgsearch. However, if someone else knows better I would love to hear it!
Physics: sophistication from simplicity.

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

Re: Running Scripts on Bgolly

Post by dvgrn » June 17th, 2015, 7:12 am

biggiemac wrote:From the time I have spent trying to get this to work I have gathered running scripts isn't possible in bgolly. That and outdated graphics libraries blocking golly prevented me from logging on to my school's linux server and running apgsearch. However, if someone else knows better I would love to hear it!
Unfortunately that's correct. According to Andrew Trevorrow, adding script-running capability to bgolly would be "a lot of work" -- not that it will never happen, necessarily, but the functionality definitely isn't there now.

Andrew offered this advice last August for people running an early version of apgsearch:
> Can ordinary Golly be instructed from the command line to run a script?

On a Mac you can do it from a Terminal window via:

open -a Golly path/to/apgsearch-2014-08-19.py

But I'm unsure if similar things are possible in Win/Linux.
If not, rename your script to golly-start.py and put it in the same
directory as Golly. It will run automatically when Golly starts up.
If hard-coding the startup parameters in a custom version of apgsearch is a helpful workaround, the relevant lines that need changing are at the beginning of the the apg_main() function, just past line 2500.

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

Re: Running Scripts on Bgolly

Post by Andrew » June 17th, 2015, 6:45 pm

bgolly is designed to be a small GUI-less program that you can run from the command line or call from a script (using any scripting language, not just Python). I don't see much point in adding scripting capabilities to bgolly. If the main motivation is to improve the speed of apgsearch then there's a much better approach: convert apgsearch into a C++ program using the gollybase code (no wxWidgets stuff would be needed). The resulting program would be significantly faster than any bgolly+Python hybrid.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Scorbie
Posts: 1693
Joined: December 7th, 2013, 1:05 am

Re: Running Scripts on Bgolly

Post by Scorbie » June 17th, 2015, 6:58 pm

]Hmm... I saw --exec option in bgolly. What does it do and bow could I use it?

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

Re: Running Scripts on Bgolly

Post by Andrew » June 17th, 2015, 7:15 pm

Scorbie wrote:I saw --exec option in bgolly. What does it do and bow could I use it?
I'm not really sure -- bgolly is Tom Rokicki's baby so you'd have to ask him for details. Looking at the bgolly code it seems to be a simple facility for testing various functions in the gollybase code. Not sure you can do anything useful with it, but check with Tom.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Scorbie
Posts: 1693
Joined: December 7th, 2013, 1:05 am

Re: Running Scripts on Bgolly

Post by Scorbie » June 17th, 2015, 8:37 pm

Thanks for the tip.

Post Reply