pyjaco icon indicating copy to clipboard operation
pyjaco copied to clipboard

input() and raw_input()

Open dusty-phillips opened this issue 14 years ago • 1 comments

using prompt() perhaps?

Note: Python 3 did away with the distinction.

dusty-phillips avatar Jan 09 '12 23:01 dusty-phillips

I think that could work, but it shouldn't be the only option.

For example, print() uses the javascript print() function when it is available. This is typically the case when run from a "js" executable. I think said "js" exe has a read() function as well, so we should make a similar multiplex for input functions.

That would mean that when run from the console, pyjaco code would behave fully like python code, using stdin and stdout. Prompting is probably a good (besides, probably the only) fallback for browsers.

chrivers avatar Jan 10 '12 10:01 chrivers