Greetings,
I installed python3 on win7,
and I would like to run the turtleDemo.py .
But can't seem to get it going.
Can anyone help?
Thanks...vm

Recommended Answers

All 23 Replies

You do something wrong.

<<You do something wrong.>>
Yes I know, that's why I am here.
Please help!
Thanks...vm

You do not tell what is your problem, what you did, what error messages...
Clipboard017

I can't find file turtleDemo.py in the Python32 installation. If you have it from older installations you might try to change
import Tkinter
to
import tkinter

In your file manager double click on one of the python source files (have extension .py) in directory
C:\Python32\Lib\turtledemo
for instance
yinyang.py

You can also run this batch file
C:\Python32\python -u C:\Python32\Lib\turtledemo\yinyang.py

Or simply use the Python editor IDLE, load the source code file and run the module.

win7HomePremium:
1)
I installed portablePython(pP) here:
C:\Users\vmars\Python3
?Does that look ok?
2)
I would like to try pyWin, but it won't let me install
because there is no pP3.2 in registry.
? How can I update the Registry for Python3.2 ?
3) When ever I cllick on *.py file,
it runs by so fast that I can't see what's going on.
?Is there a way to keep the pyconsole open 'til i decide to close it?
4)
I can't seem to get turtleDemo running.
?Can anyone step me thru this?
5)
There is a python.exe and a pythonw.exe
Which do I use when?

Thanks...Vernon

3) You assosiated the .py files with the python.exe did you not?

4) You do

    \path\to\your\python3\python -m turtledemo

from command line, like you can see from the screenshot I added to my previous post.

5) You use python.exe when you want the console windows, pythonw.exe to hide it.

It is easier for you to launch programs as newbie from IDLE or other GUI as those programs work from there (not all graphical or multitasking do)

ZZucker,

If i doubleClick on yiyang.py
up comes the python.exe prompt.
But it doesn't run yiyang.py .

If i run the following line from a yinyang.bat, I get:
Dos Window:
C:\Python32\App\Lib\turtledemo>CD C:\Python32\

C:\Python32>python.exe -u C:\Python32\App\Lib\turtledemo\yinyang.py

And python 3.2.1 comes up.
But it doesn't run yiyang.py .

Thanks...vm

pyTony,
When i run with the following TurtleDemo.bat, i get a dosWindow and a python prompt.
But doesn't run turtleDemo.py

CD C:\Python32\
python.exe -m C:\Python32\TurtleDemo-Python3.x\turtleDemo.py
pause

Thanks...vm

That is not what I told you to write, so it does not work.

Okay, I downloaded
PortablePython3.2.1.1.exe
from
http://www.portablepython.com/wiki/PortablePython3.2.1.1
and installed it on my C: drive

Now you can run the excellent IDE (a Python editor)
PyScripter-Portable
which is located in directory
C:\Portable Python 3.2.1.1

From the PyScripter's File Explorer (on the left side of the IDE) you can load
yinyang.py
from directory
C:\Portable Python 3.2.1.1\App\Lib\turtledemo
and run it from the IDE directly. Works great for me.

Note that Portable Python does not use the Windows Registry, after all it is supposed to be portable.

Thanks ZZucker,
that PyScripter is very nice.

pyTony,
"That is not what I told you to write, so it does not work."
Sorry, i'll try again:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd \

C:>Python32\python -m turtleDemo

C:>Python32\python -m turtledemo

C:>

Above is what i entered into the dos cmd.exe .
At the first command "C:>Python32\python -m turtleDemo"
it brought up the python.exe black inputScreen.
At the second command "C:>Python32\python -m turtleDemo"
it brought up the python.exe black inputScreen.

So then i had two python.exe black inputScreens running.
No turtledemo running.
...vm

In my installed Python the lib directory is directly under Python32, but it should not matter. I can not say what kind of strange problem you are having.

pyTony,

Turns out there is no turtleDemo.py within Python32 Folder.
So I downloaded TurtleDemo-Python3.x
and put it here: C:\Python32\TurtleDemo-Python3.x\ .
Then I ran turtleDemo-1.bat
which contains:

cd \
C:\Python32\python -m C:\Python32\TurtleDemo-Python3.x\turtleDemo.py

What I get back is a dos cmd.exe black screen.
And a python.exe black inputScreen.

But no sign of turtleDemo.py

Any ideas why?

Thanks...vm

-m is for running installed module and the directory you put the turtledemo is not in path.

You can see that if you try to import turtledemo and it does not import from Python command line.

Also that is whole package directory with various modules so I do not understand what you got in the directory, the stuff in python32 is like google code stuff, but there is not turtledemo.py but it runs as__main__ module in the package contained int turtledemo directory.

pyTony
Sorry, I don't understand what you are saying.
Please, tell me what directory I should put turtleDemo.py
and I'll do it.
Thanks...vm

It is not only one file, so that is why I do not get it. Normal Python installation has files like this:
turtledemo

Unless you want to run Python from a Flashcard and use it between different Windows computers, you are better off to install Python properly with the Windows installer version you get from:
http://python.org/ftp/python/3.2.3/python-3.2.3.msi

Rename your portable python directory to "C:\PortPython32" and then run the python-3.2.3.msi installer file. Now your .py files will be associated with nonportable Python in the registry. The nonportable version will usually be in directory "C:\Python32". Just don't get your portable version mixed up with the nonportable version by using the same directory name!!!!.

BTW, to run the turtle demo in Python32 you have to run file
__main__.py in directory C:/Python32/Lib/turtledemo/

Why those eggheads renamed the file? Just typical Python fabricated confusion.

Lardmeister,
Thanks!
.msi install solved the problem.
I tried to learn phthon a few years back,
and ran into these same types of problems.
So i learned HotBasic instead.
Fast and tiny executables, but not crossplatform.
I was also thinking of "Go" and "Vala".
But i'd like to give python another try.
Thanks for this:

main.py

Thanks All...vm

@Lardmeister: run main.py in directory C:/Python32/Lib/turtledemo/

This is what running the package by -m run module switch accomplishes

C:/Python32/python -m turtledemo

I see, thanks...vm

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.