Hi, I'm trying to use the turtle module in PythonAnywhere but got problems about the DISPLAY variable. I guess using this module over the web is not possible, or is it? Thanks for any suggestions.
Hi, I'm trying to use the turtle module in PythonAnywhere but got problems about the DISPLAY variable. I guess using this module over the web is not possible, or is it? Thanks for any suggestions.
you're right- using turtle wouldn't be possible. sorry about that!
Will this ever be changed?
Not anytime soon, no. We sometimes send people to our friends at http://trinket.io/?
*(see our general help page on tkinter)
i have a problem with turtle module. Python 3.8.0 (default, Nov 14 2019, 22:29:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information.
import turtle def carre(t): ... for i in range(4): ... t.fd(100) ... t.lt(90) ...
bob = turtle.Turtle() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.8/turtle.py", line 3812, in init Turtle._screen = Screen() File "/usr/lib/python3.8/turtle.py", line 3662, in Screen Turtle._screen = _Screen() File "/usr/lib/python3.8/turtle.py", line 3678, in init _Screen._root = self._root = _Root() File "/usr/lib/python3.8/turtle.py", line 434, in init TK.Tk.init(self) File "/usr/lib/python3.8/tkinter/init.py", line 2261, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variablePython 3.8.0 (default, Nov 14 2019, 22:29:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. import turtle def carre(t): ... for i in range(4): ... t.fd(100) ... t.lt(90) ...
bob = turtle.Turtle() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.8/turtle.py", line 3812, in init Turtle._screen = Screen() File "/usr/lib/python3.8/turtle.py", line 3662, in Screen Turtle._screen = _Screen() File "/usr/lib/python3.8/turtle.py", line 3678, in init _Screen._root = self._root = _Root() File "/usr/lib/python3.8/turtle.py", line 434, in init TK.Tk.init(self) File "/usr/lib/python3.8/tkinter/init.py", line 2261, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variable
is anybody have a solution? thanks
Turtle graphics don't work on PythonAnywhere; like @harry suggested earlier, you might be able to use it at http://trinket.io/.
you could also try repl.it