Reading user input

Remco Gerlich scarblac-spamtrap at pino.selwerd.nl
Fri Apr 28 07:43:28 EDT 2000


Teemu Keskinarkaus wrote in comp.lang.python:
> I'm doing some studing about python and MySQL. I've done little test
> program where I use database from python. Now I need get user input to
> do some queries(and other stuff) to database. I've read Python manual
> but haven't found simple solution to do that. I can read something
> using curses but I don't like it. Is there other(and simpler) way to
> do that??

Uhm, something like this is in the Tutorial:

x = raw_input("What is your name? ")
print "Hello, %s!" % x

That's as simple as it gets :)

> Of course I could do html-page and do my test program as CGI and use
> it that way but it's too much trouble when I'm only trying to learn
> databases and how to use them from python.

For things that are more complicated, you could make a little GUI with
Tkinter or so.

And, of course, you could run your tests from the interpreter, and just fill
in the arguments...

-- 
Remco Gerlich,  scarblac at pino.selwerd.nl
Hi! I'm a .sig virus! Join the fun and copy me into yours!



More information about the Python-list mailing list