Reputation: 3788
Like this question, I am new to Python.
I have the following simple program running in Eclipse Juno using PyDev - OSX 10.8.1. I want to pass a stdin
stream. If i were running this in the comand line it would look as follows:
python main.py < test_input.txt
How do I go about adding this to the parameters for my eclipse project?
import sys
def getArgs():
if sys.stdin.isatty():
for line in sys.stdin:
print line
def main():
getArgs()
if __name__ == "__main__":
main()
Upvotes: 4
Views: 1206
Reputation: 67063
If you look at the Common tab of the run configuration for PyDev:
You can set an output file by filling in the File
box. This will redirect standard output to the file. The Allocate console
checkbox enables standard input being in the console when running the program. Unfortunately, there is no way to specify a standard input file.
Upvotes: 6