Discussion:
Input problem
Ivan Ševčík
2011-04-21 22:05:46 UTC
Permalink
I am started a weeak ago with python, and yesterday I wodnloaded for my mobile.
However I feel that something got wrong. The problem is that when I run a script on computer that requires input, prints something and agains require input (that second just prevents from script closing before reading output), i get what I want - example :
Enter value10
10
Enter for exit

That's not the case with pythonCE. It creates dialog, I enter value, nothing is printed out and I am again prompted for exit. I find that quite strange as it's the very same code and it acts like after input is output or all commands ignored.
My code:
x = input("Enter value")
print x
raw_input("Enter for exit")

Thanks for help as this is an issue I can't move along with..
Adam Walley
2011-04-21 23:14:32 UTC
Permalink
Hello, Ivan.

Welcome to PythonCE. From your message, I think your script is probably
working fine. The problem is that blasted dialog, which is covering your
output. A very simple workaround is to add a few blank lines before printing
your x value, so that it appears below the dialog (I know this works on a
PDA, but maybe the screen size is different on a mobile phone?). Your code
might look like:

x = input("Enter value")
print 10*"\r\n" # prints 10 blank lines
print x
raw_input("Enter for exit")

Alternatively, you might want to add a short pause before the exit:

import time
x = input("Enter value")
print x
time.sleep(2) # wait 2 seconds
raw_input("Enter for exit")

HTH

Adam
Post by Ivan Ševčík
I am started a weeak ago with python, and yesterday I wodnloaded for my mobile.
However I feel that something got wrong. The problem is that when I run a
script on computer that requires input, prints something and agains require
input (that second just prevents from script closing before reading output),
Enter value10
10
Enter for exit
That's not the case with pythonCE. It creates dialog, I enter value,
nothing is printed out and I am again prompted for exit. I find that quite
strange as it's the very same code and it acts like after input is output or
all commands ignored.
x = input("Enter value")
print x
raw_input("Enter for exit")
Thanks for help as this is an issue I can't move along with..
_______________________________________________
PythonCE mailing list
http://mail.python.org/mailman/listinfo/pythonce
Loading...