[Tutor] Help with very basic question

Liam Clarke cyresse at gmail.com
Fri Nov 26 06:26:59 CET 2004


You're using the interpreter. It executes a line at at time.

Download a Python friendly editor  - 

http://www.python.org/moin/PythonEditors

I use Pype on my WinXP box, but it's personal preference. 

Write a script (i.e.)

import sys

h = raw_input("What is your name? ")
print h
sys.exit()

save it as somename.py, and run it as follows - 

python somename,py

The interactive interpreter, which has a prompt like this - 

>>>

Executes one block at at time.
You can't type more than one line(unless you're writing a  code block like - 

for a in item:

or

while x = 5:


or

try:

or

if not h:

Notice how they all end with colons? Python will pick that up and
change the promprt to

... to indicate a block.

HTH

Liam Clarke



On Thu, 25 Nov 2004 19:39:22 -0800 (PST), Harov Satmandirvich
<elrood_corrino_ii at yahoo.com> wrote:
> Hello.  Before I continue with a tutorial I would like
> to know something very basic:  Is there any other way
> to advance a line in Python than hitting
> "tabtabtabtab"..etc?   When I hit"enter?" it enters
> the line as if it was a complete bit of program.
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - You care about security. So do we.
> http://promotions.yahoo.com/new_mail
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


-- 
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.


More information about the Tutor mailing list