On 24/06/16 08:51, Hershel Millman wrote:
> Python didn't come installed on my Mac, my dad had to install it.
Nope, it definitely would have been on there because MacOS uses it.
So you definitely have two versions of python installed and it looks
like one of them (probably the default) is v2.5
Python didn't come installed on my Mac, my dad had to install it. I typed
import Tkinter into the terminal and received no error message, and when I
ran it in pycharm, I also received no error message. I found a little
program online and ran it to test the functionality of Tkinter, and it
worked.
When I try to use turtle in pycharm, it doesn't work, but when I try to use
it in the terminal, it does work. Is it possible there is something wrong
with my pycharm that is not letting it run properly?
Thank you,
Hershel
-- Forwarded message --
From: *Joaquin Alzola*
On 24/06/16 03:02, Hershel Millman wrote:
> It tells me:
> Trace back (most recent call last):
> File "", line 1, in
> NameError: name 'turtle' is not defined
As I recall, the default install of Python on a Mac
does not include Tkinter. Turtle uses Tkinter so I
suspect turtle is not
It tells me:
Trace back (most recent call last):
File "", line 1, in
NameError: name 'turtle' is not defined
Thanks!
-- Forwarded message --
From: *Steven D'Aprano*
Date: Thursday, June 23, 2016
Subject: [Tutor] Fwd: : Turtle
To: tutor@python.org
On
Millman-Family-Admins-iMac-2:~ Hershel$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle
>>> turtle.__file__
On Sun, Jun 19, 2016 at 04:21:28PM -0700, Hershel Millman wrote:
> I entered "import turtle" instead of "from turtle import * ", but it
> looks as if it did not import the pendown command. Why is that?
Good question.
Try this:
import turtle
print(turtle.__file__)
That should print something
I entered "import turtle" instead of "from turtle import * ", but it looks as
if it did not import the pendown command. Why is that?
import turtle
def drawSquare(size=100):
turtle.pendown
turtle.forward(size)
turtle.left(90)
turtle.forward(size)
turtle.left(90)