Open GoogleCodeExporter opened 9 years ago
I'm seeing this problem too on JES 4.3 on Mac, OS X 10.5.8
Original comment by ajud...@gmail.com
on 14 Dec 2010 at 6:45
Investigated some more, this time on XP
I have a simple guessing game program (below) that uses print() and raw_input()
I don't see the output from any of the print() calls until the program exits
The prompt from the raw_input() appears, however
Thanks,
Andy
------------------------------------
import random
def play():
numToGuess = random.randint(1,20)
while True:
guess = int(raw_input("Guess?"))
if guess == numToGuess:
print "Yes!!!"
break
elif guess > numToGuess:
print "Too high"
else:
print "Too low"
return
def main():
while True:
play()
resp = raw_input("Play again?")
if resp == "no" or resp == "No":
break
print "Adios!"
Original comment by ajud...@gmail.com
on 14 Dec 2010 at 7:42
Andy,
There is a printNow function that you might check out.
Tom
Original comment by tompwha...@gmail.com
on 15 Dec 2010 at 2:59
I'd second this request. I'm thinking of using JES for teaching but the lack of
print and input/raw_input statements would mean that sample programs from
elsewhere wouldn't work. Not realising this, I tried a baby version of Eliza,
and when pasted into JES and run, it appeared to just hang. In reality, it was
waiting for input, but it wasn't obvious as nothing was shown to the user.
Given that there's so much tutorial Python info about, and beginners are likely
to try and run code they find elsewhere, the inability to run standard python
is likely to be confusing.
Any hope of making the standard I/O calls work in the console window?
Thanks - Gino
Original comment by Gin...@gmail.com
on 19 May 2011 at 7:13
[deleted comment]
I've just discovered (using Jes 4.3 on Windows 7), that the print statement
does work when it's inside a function, but not if it's at the top level (i.e.
so it's executed when a program is Loaded):
================================
def fn():
x = input ("how many times: ")
print "this works " * x
print "this doesn't"
================================
Calling fn() from the console displays the input prompt and then the output
from the print but the print outside doesn't display anything.
Cheers Giovanni
Original comment by Gin...@gmail.com
on 19 Jul 2011 at 5:40
Original issue reported on code.google.com by
tompwha...@gmail.com
on 11 Jul 2010 at 2:17