ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 04 Jul 2022 08:06:42 +0200It is possible to use Pygame or Turtle with Sage?https://ask.sagemath.org/question/63050/it-is-possible-to-use-pygame-or-turtle-with-sage/ Hello from France ,
the question is in the title.
For example , whem i am using tutrle whit sage's jupiter , i see this error " no display name and no $display environment variable " , probably the same for pygame will apparead with pygame.
Tue, 28 Jun 2022 23:59:39 +0200https://ask.sagemath.org/question/63050/it-is-possible-to-use-pygame-or-turtle-with-sage/Answer by slelievre for <p>Hello from France , </p>
<p>the question is in the title.</p>
<p>For example , whem i am using tutrle whit sage's jupiter , i see this error " no display name and no $display environment variable " , probably the same for pygame will apparead with pygame.</p>
https://ask.sagemath.org/question/63050/it-is-possible-to-use-pygame-or-turtle-with-sage/?answer=63098#post-id-63098Some results from this web search query helped me:
- [web search: turtle python jupyter](https://duckduckgo.com/?q=turtle+python+jupyte)
in particular this one:
- [How to make python turtle works in Jupyter](https://medium.com/@jiyuanli93/how-to-make-python-turtle-works-in-jupyter-notebook-6c506b9a973f)
## Turtle for Sage in Jupyter
In a Jupyter sheet running the Sage kernel, run
%pip install ipyturtle
Then restart the kernel, and the following should work:
from ipyturtle import Turtle
t = Turtle()
t
## Pygame for Sage in Jupyter
In a Jupyter sheet running the Sage kernel, run
%pip install pygame
Then Pygame should work for you in Sage.
Mon, 04 Jul 2022 08:06:42 +0200https://ask.sagemath.org/question/63050/it-is-possible-to-use-pygame-or-turtle-with-sage/?answer=63098#post-id-63098