Python Input from keyboard
MonkeeSage at gmail.com
Sat Sep 23 00:32:59 CEST 2006
> I want to read some input continuously from keyboard and then I would
> like to process these input.
> I have a code like this but getting errors, I would like to terminate
> when there is an empty string in the input, why is not this easy as the
> "cin" or "scanf". I had to search for even this easy operation. Is
> there a way to send EOF signal to terminate input(ctrl+??????)
You can send a signal (check the signal module in the docs), but you
can also just do what you wanted:
x = 
y = 
msg = 'input x and y values : '
uin = raw_input(msg).strip()
if not uin:
print 'you have not entered x or y, quiting'
xt, yt = uin.split(' ', 1)
for i in range(len(x)):
More information about the Python-list