jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

Including input function and some imports from __future__ #282

Open TobiasBaeumlin opened 4 years ago

TobiasBaeumlin commented 4 years ago

As I am using processing.py to teach an introductory course to computer science I'd be interested to have an input function:

def input(message=''):
    from javax.swing import JOptionPane
    return JOptionPane.showInputDialog(frame, message)

from a solution mentioned in an answer to another request.

Additionally I need some imports from future, namely division, print_function and unicode_literals.

For the time being I managed to do that by patching some files in modes/PythonMode.jar.

Would it be possible to add these changes in the officially distributed version of the Python mode?

Regards Tobias

jdf commented 4 years ago

Why can you not use that input function? It works fine for me.

What files did you patch?

arbuscula commented 3 years ago

Yes, I can use the function above. But for use in a class room I'd like to hide it from the students and have it transparently available.

I patched jycessing/core.py in PythonMode/mode/PythonMode.jar:

Would it be possible to add something along these lines in the distribution of PythonMode?