Re: [Tutor] Re Help with this script

2005-04-29 Thread John Carmona
Hi Alan, I did not receive personally your last email but I have read it on the forum. OK i understand now what you were talking about, sorry it took such a long time for me to see the solution, the good thing about it is that I am learning tons. I will probably post soon again once I hit a wa

Re: [Tutor] Re Help with this script

2005-04-28 Thread Alan Gauld
> OK Alan, I thing I have seen the light!!. Almost. :-) > - > def print_options(): >print "--" >print "Options:" >print "a. print options" >print "f. quit the prog

Re: [Tutor] Re Help with this script

2005-04-27 Thread jfouhy
Quoting John Carmona <[EMAIL PROTECTED]>: > Is it that if you use "while 1:" you create a recursive function? Hope I > am right. No ... Remember how functions can call other functions? def add(x, y): """ Add two integers together. """ return x+y def mul(x, y): """ Multiply two inte

Re: [Tutor] Re Help with this script

2005-04-27 Thread John Carmona
OK Alan, I thing I have seen the light!!. Here is the script that Kent and you asked me to look at modified: - def print_options(): print "--" print "Options:" print "a. print opt

Re: [Tutor] Re Help with this script

2005-04-26 Thread Alan Gauld
> OK the situation is that I haven't still found out what the answer is, I > have noticed in the other hand that if I select the option "a" let's say 4 > times, I need to enter the option "f" 4 times. I am curious to know what the > solution is. I have read your chapter on recursion but that did no

Re: [Tutor] Re Help with this script

2005-04-26 Thread John Carmona
Hi Alan, sorry for not replying sooner I am right in the middle of setting up a network at home. Thanks for your email. OK the situation is that I haven't still found out what the answer is, I have noticed in the other hand that if I select the option "a" let's say 4 times, I need to enter the

Re: [Tutor] Re Help with this script

2005-04-25 Thread Alan Gauld
> can't see it really, i thought that the fact to have the "break" command > would terminate the script straight away. break terminates the current loop, which is inside your print_options function. print_options is called from inside print_options. Research the term "recursion" and see if you ca

Re: [Tutor] Re Help with this script

2005-04-25 Thread John Carmona
Thanks Kent, as far as I can see I get the same problem that on my script, i need to enter "f" 3 to 4 times before I exit the programme. Hmmm, why, I can't see it really, i thought that the fact to have the "break" command would terminate the script straight away. If I enter "f" first then the

Re: [Tutor] Re Help with this script

2005-04-24 Thread Kent Johnson
John Carmona wrote: Thanks for the help Kent, Noel and Alan. Here is my final script (it seems to be working ok but sometimes if I select "quit the programme", I need to enter that option 2 or 3 times before it works, is this a bug Try this program. Choose option a a few times, then choose f enou

Re: [Tutor] Re Help with this script

2005-04-24 Thread John Carmona
Thanks for the help Kent, Noel and Alan. Here is my final script (it seems to be working ok but sometimes if I select "quit the programme", I need to enter that option 2 or 3 times before it works, is this a bug (I am running Win XP), please feel free to comment if you thing that something could

Re: [Tutor] Re Help with this script

2005-04-23 Thread Kent Johnson
John Carmona wrote: Thanks Kent, it is working now. Is this what you meant in your reply? Because if I set up the main code at the end of the script I was still getting an error message. Yes, that's what I meant, though you just need task_options() rather than print task_options() When you say pr

Re: [Tutor] Re Help with this script

2005-04-23 Thread Max Noel
On Apr 23, 2005, at 15:44, John Carmona wrote: Thanks Kent, it is working now. Is this what you meant in your reply? Because if I set up the main code at the end of the script I was still getting an error message. Also, what do I need to use if for example I want my code to rerun once I have co

[Tutor] Re Help with this script

2005-04-23 Thread John Carmona
Thanks Kent, it is working now. Is this what you meant in your reply? Because if I set up the main code at the end of the script I was still getting an error message. Also, what do I need to use if for example I want my code to rerun once I have computed let's say a volume. Right now the execut