Python Forum

Full Version: Can't access Turtle Demo
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm new to this forum and not sure if I've picked the right one.

I'm also new to Turtle graphics. and I'm trying to access the Demo scripts referenced in the Python Documentation Standard Library, 24.1.7.

I'm operating on a Mac, and I've tried to access the scripts on the terminal, but no luck.

Any suggestions will be appreciated.
It would be helpful to know which version of Python you are using, what you are typing in the command terminal to invoke 'turtledemo' and what you get when you do.
Thanks for the prompt response. I'm using Python 3.6.4.

Here's a screenshot of my terminal window. As you can see, I've tried several ways.

Last login: Sun Feb 4 11:45:12 on ttys000
Mac-mini:~ BillHatfield$ python3.6
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle
>>> python -m turtledemo
File "<stdin>", line 1
python -m turtledemo
^
SyntaxError: invalid syntax
>>> python -m turtledemo.py
File "<stdin>", line 1
python -m turtledemo.py
^
SyntaxError: invalid syntax
>>> python =m turtledemo.bytedesign
File "<stdin>", line 1
python =m turtledemo.bytedesign
^
SyntaxError: invalid syntax
>>> python =m turtledemo.bytedesign.py
File "<stdin>", line 1
python =m turtledemo.bytedesign.py
^
SyntaxError: invalid syntax
>>>
Greetings everyone, I am having this exact same issue and hoping that a solution was found.

Can anyone assist?

I'm running on a Mac and my version is 3.7. See below for my obviously poor attempts at doing this. I am very new to coding so please aim solutions at dummy level.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> python -m turtledemo
SyntaxError: invalid syntax
>>> python turtledemo.py
SyntaxError: invalid syntax
>>> python turtleDemo.py
SyntaxError: invalid syntax
>>> python -mturtleDemo
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
python -mturtleDemo
NameError: name 'python' is not defined
>>> python /user/CliMac/Documents/Python/TurtleDemo-Python3.x/turtleDemo.py
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
python /user/CliMac/Documents/Python/TurtleDemo-Python3.x/turtleDemo.py
NameError: name 'python' is not defined
>>> python /path/to/filename.py
You need to type python -m turtledemo at the command line, not in the Python interpreter.