New to python, can i ask for a little help?

W

warhammer1805

I loaded python 3.1
I can use the gui and i see the following:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
It would seem that this is working correctly and there is no path
problem.
I am running windows vista.

When i put in a test string i see this:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
Can anyone tell me what is wrong? I didnt expect that error....

Andrew
 
C

Chris Rebert

I loaded python 3.1
I can use the gui and i see the following:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
It would seem that this is working correctly and there is no path
problem.
I am running windows vista.

When i put in a test string i see this:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
Can anyone tell me what is wrong? I didnt expect that error....

The print-statement was removed in Python 3.0. Now it's just a
function. You'll have to use:

print("hello world!")

instead.

Please also read the 3.0 transition docs:
http://docs.python.org/3.0/whatsnew/3.0.html
Note that Python 3.0 differs significantly from Python 2.x

Cheers,
Chris
 
M

Mensanator

I loaded python 3.1
I can use the gui and i see the following:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.



It would seem that this is working correctly and there is no path
problem.
I am running windows vista.

When i put in a test string i see this:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.>>> print "hello world!"

SyntaxError: invalid syntax (<pyshell#0>, line 1)



Can anyone tell me what is wrong?

You're using Python 3.0.1. Print is now a function.
I think you would do print("Hello World"). Look it
up in the documentation.
I didnt expect that error....

And it would have worked in Python 2.x.
 
G

guang.zeng37

I loaded python 3.1
I can use the gui and i see the following:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.



It would seem that this is working correctly and there is no path
problem.
I am running windows vista.

When i put in a test string i see this:

Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.>>> print "hello world!"

SyntaxError: invalid syntax (<pyshell#0>, line 1)



Can anyone tell me what is wrong? I didnt expect that error....

Andrew

print is a function. So you should do it this way: print("hello
world!")
 
C

Chris Rebert

I loaded python 3.1
I can use the gui and i see the following:
Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
It would seem that this is working correctly and there is no path
problem.
I am running windows vista.
When i put in a test string i see this:
Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
print "hello world!"
SyntaxError: invalid syntax (<pyshell#0>, line 1)
Can anyone tell me what is wrong? I didnt expect that error....

The print-statement was removed in Python 3.0. Now it's just a
function. You'll have to use:

print("hello world!")

instead.

Please also read the 3.0 transition docs:http://docs.python.org/3.0/whatsnew/3.0.html
Note that Python 3.0 differs significantly from Python 2.x

Cheers,
Chris
--http://blog.rebertia.com

Hi Chris,
Thank you for the pointer! that sure helped alot.
Do you think i should be using a different version of python? I dont
normally do much programming. I used to do some C along time ago. I
want to get into something again and python seems to be popular.

You should probably use Python v2.6 instead for the time being; most
libraries have yet to be ported to Python 3.0, so 2.6 has many more
libraries available for it currently. Python 3.0 is also mostly the
same as 2.6, so learning 2.6 won't be a waste of time and will help
you when the full transition to 3.0 is eventually made.
Could you also tell me who uses python in IT areas? I see alot of
python and Mysql. And i see python developer jobs as standalone too.

See http://www.python.org/about/apps/ and http://www.python.org/about/success/

Cheers,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top