Pycharm: reading from stdin in "debug" mode
I am debugging this script in PyCharm:
import sys
def read_in():
lines = sys.stdin.readlines()
for i in range(len(lines)):
lines[i] = lines[i].replace('\n','')
return lines
def main():
lines = read_in()
print lines
if __name__ == '__main__':
main()
I usually call this a script with a command like cat data.txt | python script.py
that which passes data.txt to standard input.
My question is how do I set up the "Run / Debug Configuration" in PyCharm, which also passes the data.txt file to standard input, but which will allow me to use PyCharm's debug mode? I suspect I need to fill in the "Script Parameters" field correctly, but so far it hasn't escaped.
Thank.
+3
source to share