gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
59 stars 38 forks source link

Can't flush stdout before asking for user input #47

Open leafstorm opened 10 years ago

leafstorm commented 10 years ago

From wendy.powley@gmail.com on September 21, 2010 18:03:30

What steps will reproduce the problem? import sys def test(): print "I am testing" sys.stdout.flush() value = input("enter integer") print value What is the expected output? What do you see instead? Expected:
I am testing enter integer ....

Instead: The print statement is not flushed to the screen. What version of the product are you using? On what operating system? JES 4.3 Please provide any additional information below.

Original issue: http://code.google.com/p/mediacomp-jes/issues/detail?id=47

leafstorm commented 10 years ago

From wendy.powley@gmail.com on September 21, 2010 17:23:48

Sorry, I forgot to say that I'm working on Windows 7

leafstorm commented 10 years ago

From wendy.powley@gmail.com on September 22, 2010 16:38:47

Never mind ... I figured it out.

leafstorm commented 10 years ago

From pammeier...@gmail.com on August 25, 2013 16:54:36

Has this been fixed?

leafstorm commented 10 years ago

From guzd...@gmail.com on August 25, 2013 17:45:26

input() will not work correctly in JES, because of an interaction between Swing and the Jython interpreter. sys.stdout.flush() is unlikely to work (or rather, it will work, but the Console won't update until the execution ends). That's why we created requestString() instead. These issues are discussed in the book.

leafstorm commented 10 years ago

From pammeier...@gmail.com on August 26, 2013 11:11:45

Thank you very much. I'm new to the book and teaching the class, so I'm learning as I'm going.