473,378 Members | 1,721 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,378 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 1465
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.