Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An animation render question #63

Open
pointm opened this issue Feb 20, 2021 · 4 comments
Open

An animation render question #63

pointm opened this issue Feb 20, 2021 · 4 comments

Comments

@pointm
Copy link

pointm commented Feb 20, 2021

Dear developer
I have coloned your Python library to "D:/seagull" in my PC , and installed the components mentioned in the README.md file . Then I opened "D:/seagull" with VSCode and add an Python file named "new_life.py" in "D:/seagull" . After that , I added the code you have showed in READMD.md like:

import seagull as sg
from seagull.lifeforms import Pulsar

board = sg.Board(size=(19,60))  


board.add(Pulsar(), loc=(1,1))
board.add(Pulsar(), loc=(1,22))
board.add(Pulsar(), loc=(1,42))

sim = sg.Simulator(board)      
sim.run(sg.rules.conway_classic, iters=1000)

sim.animate()

For showing the result , I also added the 'sim.animate' at the end of the file . But after that , when I run "D:/seagull/new_life.py" with VSCode , the terminal showed:

d:/programe_for_large/anaconda3/python.exe d:/seagull/new_life.py

2021-02-20 23:12:00.686 | INFO | seagull.simulator:compute_statistics:128 - Computing simulation statistics...

2021-02-20 23:12:00.746 | INFO | seagull.simulator:animate:183 - Rendering animation...`

And after that no window popped out , I couldn't see the same result you showed in README.md . Did I misunderstand the function of your library or anything I do wrong during my action ? Thank you so much !

@balisujohn
Copy link

It looks like some time has passed since this question, but I have an answer for you. You need to call plt.show() after the lines you're calling above. I think the reason plt.show() is not included in the README example is because the default assumption is that this would be run from a notebook instead of in a script directly invoked from the command line, and in the setting of a notebook, plt.show() is not required.

@ljvmiranda921
Copy link
Owner

Hi @pointm sorry I wasn't able to reply for a very long time--life happened. Yes, @balisujohn's answer is the key. Thanks for replying!

@pointm
Copy link
Author

pointm commented Sep 30, 2021

Thank You Very Much_(:з」∠)_

@mdoream
Copy link

mdoream commented Mar 20, 2024

Hi

So there is still no way to run this outside of notebook?
How to show the beard with animation just on the simple window?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants