Fwd: newbie question regarding int(input(:)) - sorry for the spam
Craig Ward
sour.craig at gmail.com
Fri Jan 11 11:31:24 EST 2008
sorry for the spam Here is the complete message!
I am trying to write a menu script that will execute bash scripts.
Everything is fine until the script executes and I want to see if there are
any more options to run before quitting.
Example:
=================================================
def menu(opt1 = "something", opt2 = "something else"):
print "1)", opt1 ""
print "2)", opt2""
def anythingelse(opt 3 = "final check"):
menu()
print "3)", opt3""
menu()
choice = int(input(":"))
if choice == 1
command
anythingelse()
elif choice == 2
command 2
anythingelse()
else choice ==3
command 3
quit
=======================================
My newbie problem is that although the menu repeats there is no chance to
have a second input and I can't put the int(input(":") in the function
because I get the error 'int' is not callable plus my choice variable is not
defined. can someone please enlighten me? :-)
---------- Forwarded message ----------
From: Craig Ward <sour.craig at gmail.com>
Date: Jan 11, 2008 11:21 AM
Subject: newbie question regarding int(input(:))
To: python-list at python.org
Hi experts!
I am trying to write a menu script that will execute bash scripts.
Everything is fine until the script executes and I want to see if there are
any more options to run before quitting. Example:
def menu(opt1 = "something", opt2 = "something else"):
--
Computers are like air conditioners.
They stop working when you open Windows.
--
Computers are like air conditioners.
They stop working when you open Windows.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080111/256cbb81/attachment.html>
More information about the Python-list
mailing list