isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Added interactivity check from #208 #209

Closed FliiFe closed 8 years ago

FliiFe commented 8 years ago

If the program is not linked to a tty (thus running from a non-interactive shell), run the program given from stdin. Supports multiline input. Fixes #208

Example usage :

$ echo 'V5"helllo, world' | pyth.py
hello, world
hello, world
hello, world
hello, world
hello, world
orlp commented 8 years ago

I undid this with my most recent commit. Before this commit it was impossible to pipe in actual input to stdin. -x is for executing stdin, it should not be default behavior.

After my change this works again:

$ python3 pyth_lang/pyth.py -m -d golf.pyth < stdin