Unable to redirect script output to a file
Hi,
I have a python script that when run outputs to screen. eg. ./international_sms_check.py 0403000511 919227434827 TS 21 check ok TS 22 check ok sms successfully delivered from 61403000511 to 919227434827 But when I try: ./international_sms_check.py 0403000511 919227434827 > test The file test is created but there is nothing in it. if I try ls > test this works fine with output of ls redirected to file test. Can anyone help :( |
Maybe it writes to standard error instead of standard output. You can verify using:
Code:
./international_sms_check.py 0403000511 919227434827 > test 2>&1 |
Unable to redirect script output to a file
I tried ./international_sms_check.py 0403000511 919227434827 > test 2>&1
But nothing in test2 file :( |
What python statements did you use to print out the messages? The solution can be in the python code itself, but it's hard to tell without knowing how it is implemented.
|
YES, thank you :) checked code, and was exiting with 1 instead of zero.
|
All times are GMT -5. The time now is 07:24 AM. |