Menu

golly in a jupyter notebook?

2017-07-17
2017-07-17
  • Norman Packard

    Norman Packard - 2017-07-17

    Anyone ever try executing golly script code from a jupyter notebook?
    Is it even possible (feasible) to do?

    I have been trying to figure out how to get access to the golly python module outside of the golly GUI. Is this possible? I don't see any flags on bgolly that indicate script execution. (...or am I missing something?)

     
  • Andrew Trevorrow

    Sorry, but Python (and Lua) scripting is only available from within the Golly application. I can't see that changing any time soon. If you provide more details about what you want to do then maybe there is another solution.

     
  • Norman Packard

    Norman Packard - 2017-07-26

    Thanks for the quick response!
    Is it possible to access Python/Lua scripts from bgolly (batch mode running)?

    Basically, I am involved in a project that is investigating the addition of genome's to game of life individuals (cells with a 1), where the genome can control the birth process (of neighboring dead cells), with the goal of looking for evolutionary properties of such a system.

    I thought maybe golly could be leveraged as a simulation engine for the project. Now turning to a fast C implementation with a python wrapper for visualization and exploration.

     
    • Adam P. Goucher

      Adam P. Goucher - 2017-07-27

      <html><head></head><body>


      A Golly script can be set to automatically run from the command line by calling:

       
      golly scriptname.py
       
      in a non-interactive manner. Now, I don't know whether it's possible to quit Golly from within a Python script, but you can certainly cheat by creating a Bash script which invokes 'golly scriptname.py' and periodically checks for the appearance of an output file in the working directory (saved by the Python script upon completion) and killing the Golly process.
       
      Sent: Wednesday, July 26, 2017 at 11:46 PM
      From: "Norman Packard" <nhpackard@users.sf.net>
      To: "[golly:discussion] " <467856@discussion.golly.p.re.sf.net>
      Subject: [golly:discussion] golly in a jupyter notebook?

      Thanks for the quick response!
      Is it possible to access Python/Lua scripts from bgolly (batch mode running)?

      Basically, I am involved in a project that is investigating the addition of genome's to game of life individuals (cells with a 1), where the genome can control the birth process (of neighboring dead cells), with the goal of looking for evolutionary properties of such a system.

      I thought maybe golly could be leveraged as a simulation engine for the project. Now turning to a fast C implementation with a python wrapper for visualization and exploration.


      golly in a jupyter notebook?


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/golly/discussion/467856/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       




      </body></html>

       
  • Andrew Trevorrow

    Further to Adam's reply:

    Another way to automatically run a script when Golly starts up is to put a script called golly-start.py (or golly-start.lua if it's a Lua script) in the same directory as the executable.

    And you can easily quit Golly from a script by calling

    g.doevent("key q cmd")

    That will work on all platforms because the cmd modifier corresponds to the command key on a Mac or the control key on Windows/Linux.

     

Log in to post a comment.