Hi,

Just started using python. I can run simple python programs from the terminal in OS X. It says python version 2.6.1. I wanted to try turtle. I copied some code I found from others on here and tried to run it, and ran into problems right away with things like color("green") or something. I ran some code to see if turtle was installed, and it seemed to install, but it looks like the commands don't get recognized.

Is there something I am doing wrong? Can someone give me the simplest bit of code to try to see if turtle works?

Thanks for any help.

I can get tinker to open a window from the terminal in OS x

Can nobody offer me any help?

Is there something I am doing wrong?

There is no way to tell what you are doing. You didn't post any code to comment on. Take a look at vegaseat's example here and see if it helps you.

There is no way to tell what you are doing. You didn't post any code to comment on. Take a look at vegaseat's example here and see if it helps you.

On the following code called from the terminal on OS X with Python 2.6.1

from turtle import *

turtle.setup(400,400)

The following comes out ...

python stuff.py
Traceback (most recent call last):
File "stuff.py", line 2, in <module>
from turtle import *
File "/Users/jharding/turtle.py", line 11, in <module>
NameError: name 'turtle' is not defined


I suspect the module turtle is not installed with the python application

Edit: I tried the example you suggested (actually I tried it before too) and a similar error comes out.

Hi,

The error was mine, stupid, but hard to find. I named the file I first used to try out the turtle graphics, well, turtle. I changed the name later to another, but this stayed in my directory and was what the thing tried to load. In any case when I removed the file with the name turtle, everything worked fine.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.