473,232 Members | 1,636 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,232 software developers and data experts.

New to Python-- Help

I just installed Python on Windows XP Pro. When I enter 'python' at the >>>
prompt in Pythonwin IDE I get the following:

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
Name Error: name 'python' is not defined

Can anyone help?

Thank you,

J. T. Cook
Aug 8 '06 #1
4 1461
John & Mary Cook wrote:
I just installed Python on Windows XP Pro. When I enter 'python' at the
>prompt in Pythonwin IDE I get the following:

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
Name Error: name 'python' is not defined

Can anyone help?

Thank you,

J. T. Cook
Did you install Python, or Pythonwin ?

Cannot use #2 without #1.

Philippe

Aug 8 '06 #2
John & Mary Cook wrote:
I just installed Python on Windows XP Pro. When I enter 'python' at the >>>
prompt in Pythonwin IDE I get the following:

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
Name Error: name 'python' is not defined

Can anyone help?

Thank you,

J. T. Cook
That's because the Pythonwin IDE with the >>prompt is already running
the Python interpreter. The Python interpreter allows you to run
python statements and expressions with instant feedback.

Python doesn't define the 'python' name inside of itself.

I recommend that you read through the Python tutorial, and maybe do a
Google search for Python tutorials.

When you next see the >>prompt, try typing in the following:
import this
print ' '.join( ('Python', 'rocks!') )

Aug 8 '06 #3
Are you refering to IDLE? or simply running python at the command
line?

In either case - python is just the language's name. It is not a
defined name within the language.

If you describe what you are trying to do, perhaps some more specific
help could be had.

What is happening:
There currently is no name in the interpreter called python and it is
telling you that

Try this.
>>python = "A cool language"
python
'A cool language'
>>dir()
['__builtins__', '__doc__', '__name__', 'python']
>>>
btw: dir() is a way of getting the currently defined names
you could also try this - just to get a feel for the names

you can also request the names going down the heirarchy.

enter:
dir(__doc__)
and see what happens.

Happy Pythoning.

John & Mary Cook wrote:
I just installed Python on Windows XP Pro. When I enter 'python' at the >>>
prompt in Pythonwin IDE I get the following:

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
Name Error: name 'python' is not defined

Can anyone help?

Thank you,

J. T. Cook
Aug 8 '06 #4

Philippe Martin wrote:
John & Mary Cook wrote:
I just installed Python on Windows XP Pro. When I enter 'python' at the
>>prompt in Pythonwin IDE I get the following:
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
Name Error: name 'python' is not defined

Can anyone help?

Thank you,

J. T. Cook

Did you install Python, or Pythonwin ?

Cannot use #2 without #1.
He probably used ActivePython. It includes both. Besides PythonWin IDE
won't start without Python :-)

John:
Try this tutorial. It does not assume a programming background.
http://honors.montana.edu/~jjc/easytut/easytut/

You already started Python when you started PythonWin IDE. You won't
need to type python in it again :-)

In the tutorial I linked, PythonWin is analogous to IDLE (another IDE)
mentioned in it. You should also have IDLE installed in your menus.

Aug 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tlo | last post by:
hello, i would like to do the following, and as i had never used python in a network framework i would like to have opinions on this : i would like to provide some kind of network quizz game,...
32
by: Sticks | last post by:
i'm new to python and i was wondering what editors people prefer to use and why.
0
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to...
0
by: python-help-bounces | last post by:
Your mail to 'Python-Help' with the subject ello! =)) Is being held until the list moderator can review it for approval. The reason it is being held: Message has a suspicious header
1
by: Matt Upton | last post by:
Hello, I am new to Python and am trying to produce script to run batch processes for ArcGIS 9.0 (ArcView). I have upgraded to Phython 2.4 from 2.1 and am using the Pythonwin to try to code but am...
0
by: Leeds, Mark | last post by:
This is a follow up question To the previous question About sorting that I sent for my friend. -----Original Message-----
2
by: Scott Smith | last post by:
To all you vi/vim users out there..... I am just getting into python and am trying to learn how to use the python.vim script. I really like the fact that it autoindents for me while inserting...
1
by: Lad | last post by:
On my website I allow users to upload files. I would like a user to see how much time is left before a file is uploaded. So, I would like to have a progress bar during a file uploading. Can Python...
4
by: mlimber | last post by:
I'm writing a text processing program to process some survey results. I'm familiar with C++ and could write it in that, but I thought I'd try out Python. I've got a handle on the file I/O and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.