문제

How can I pass an input file to a Python script in Aptana python debugger? From console I do something like:

python test.py < input.txt

I tried editing the debug configuration in order to add the input file as program arguments, but it does not work.

enter image description here

도움이 되었습니까?

해결책

I'm not sure if Aptana can handle this. If not, just override sys.stdin in test.py:

import sys
sys.stdin = open('input.txt', 'r')
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top