Ask Your Question
1

How to redirect input in debugger?

asked 2021-07-03 08:52:36 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I can run my program from command line and pass in input from a file, e.g.

python ./test_program.py < sound\sound.i0

How can I do the equivalent in the wing IDE so I can take advantage of the debugger and breakpoints?

I've tried setting the debug preferences to "use external console" and not "use sys.stdin Wrapper" but when I try to pass in arguments "< sound\sound.i0" via "Use Project Settings and the Following Run Args", the input file is not read in - the program just seems to hang on a line such as

nmc = input().split()

I suppose this is because it is not getting any input from my argument "< sound\sound.i0"

I've figured out that if I cut and paste lines into the I/O window at the right time, the input it parsed properly, but since my input file is 100s or 1000s of lines this is not practical.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-07-03 12:30:03 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Answered my own question, this works for me, I can start the program from the command line and let the debugger connect and take control in Wing:

http://wingware.com/doc/debug/debuggi...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-07-03 08:52:36 -0500

Seen: 61 times

Last updated: Jul 04