2

In command line, i run my script as follows:

cat sample.log | python -B main.py logsource

How do i debug the main.py and provide:

  • sample.log as sys.stdin
  • -B for python
  • logsource as input parameter (sys.argv[1])

I'm using Python 3 if it matters.

XoXo
  • 1,560
  • 1
  • 16
  • 35

1 Answers1

0

Piping a file to stdin isn't supported when launching a debug process from Wing. You can, however:

  • Add -B to the Python Options under Debug/Execute tab in Project Properties (from the Project menu)
  • Add the logsource arg under the Debug/Execute tab of File Properties for main.py (right click on it and select Properties)

Another option is to add 'import wingdbstub' to main.py as described in http://wingware.com/doc/debug/debugging-externally-launched-code to start debug. Then you can just type the command line as above and don't need to set anything in Project Properties or File Properties.

Wingware
  • 896
  • 5
  • 12