-2

When a python script is executed inside a python script, I do not get the complete output. In my case:

os.system('python -u capture.py > capture.log &')

where capture.py will capture the packets and feeds this to capture.log.

Capture.py will keep sending packets every 100 sec. I couldn't see the complete output in to the file. Only the initial captures are put to capture.log because capture.py doesn't capture any packets after some time.

However, when I execute the same script via "python -u" in the bash prompt, it works.

code11
  • 1,986
  • 5
  • 29
  • 37

1 Answers1

0

You can't start a subprocess with io.system(...).
Read the docs: os.system

You have use module-subprocess

stovfl
  • 14,998
  • 7
  • 24
  • 51