[Tutor] A few newbie questions ...
Deirdre Saoirse
deirdre@deirdre.net
Fri, 18 Feb 2000 10:36:15 -0800 (PST)
On Fri, 18 Feb 2000, Joseph Stubenrauch wrote:
> 1. Can someone point me to the module (if it exists)
> that would allow me to do such C++ type things as
> clearscreen, change the background/foreground colors,
> and especially, a python equivalent of C++'s gotoxy.
Typically, that's a function of the terminal. You don't say what you're
using (Unix or ?), but in Unix that's a function of curses.
> 2. Is it possible to have input be either a string or
> number, depending on what the user inputs? In other
> words, I would like to create a menu with options
> #1-4, and option X and Q to quit. Is that possible?
You can try and convert a string to a number and assume it's a string if
that fails:
a = "foo"
try:
b = int(a)
except:
b = a
print b
> I would love any help you can offer. I just
> downloaded python two days ago and I am LOVING it!
Cool!
--
_Deirdre * http://www.linuxcabal.net * http://www.deirdre.net
"Mars has been a tough target" -- Peter G. Neumann, Risks Digest Moderator
"That's because the Martians keep shooting things down." -- Harlan Rosenthal
<Harlan.Rosenthal@Dialogic.com>, retorting in Risks Digest 20.60