[Tutor] getting started

alan.gauld@bt.com alan.gauld@bt.com
Fri Nov 15 13:43:02 2002


> I want to do the following:-
> 
> >>>print "xxxxxxxxxxxxxxx"
>       print "yyyyyyyyyyyy"
>       print "zzzzzzzzzzzzzz"
> 
> How to get from ........x"    to    commence print  "yyyyy..........
> 'Enter' key of course executes the command. 

Which is what any interpreter does. It executes your code one line at a
time.
If you need to execute a group of lines at once there are several options:
1) Put then in a function(you may not have reached those yet!)
2) separate them with semicolons on the same line
3) put them in a small file. To save using lots of files use the same 
   name each time: test.py say... You'll lose your last set but then 
   thats true of the >>> prompt too!

I'd recommend none of these but just get used to using the prompt with
each line executing as you enter it... Otherwise go to option 3 until 
you learn about functions.

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld