We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I have been working in python, and love the fact that I can use the processing IDE, setup, and awesome visually Processing features. However, one of the most useful and basic features is missing. text = raw_input("Enter some text: ")
You get; IOError: The handle is invalid
Enter some text: processing.app.SketchException: IOError: The handle is invalid at jycessing.mode.run.SketchRunner.convertPythonSketchError(SketchRunner.java:243) at jycessing.mode.run.SketchRunner.access$4(SketchRunner.java:222) at jycessing.mode.run.SketchRunner$3.run(SketchRunner.java:117) at java.lang.Thread.run(Unknown Source)
I would appreciate a work around or way that brings up a command line window.
Thank you very much!
Answers
Dunno about Python and its Python Mode much... But Java has a class called Scanner:
http://docs.Oracle.com/javase/8/docs/api/java/util/Scanner.html
It can be used to get input from the console.
Even though it doesn't throw any Exception, nothing happens while using Processing's PDE.
But once exported and run from the command line, it magically works! :bz
Who knows it's the same issue w/ Python's raw_input()? :-/
The processing sketch does not run in a real console; this technique will not work in the PDE.
It may work fine using the processing.py command line, but I'm not sure.
I'm not sure this helps but here I go:
How about a nasty swing InputDialog?
Cancel button will make it return
None
July 2015...