I am using a python script(x.py) that required to be run using terminal, but I have a large list that need to be iterate so I did a script that can call the x.py but I could not save the output due to sys.stdout.isatty(), how can I make python script think it runs using atty
device?
Asked
Active
Viewed 118 times
0
-
what do you exactly mean by `think it runs using terminal` ? or you could check [here](https://stackoverflow.com/questions/858623/how-to-recognize-whether-a-script-is-running-on-a-tty) – Onyambu Sep 13 '19 at 17:05
-
@Onyambu I want to run it using python IDE not the terminal and I do not have control over the original script – Samah Sep 13 '19 at 17:26
2 Answers
0
I've used 'unbuffer' which is part of the 'expect' package. Search for unbuffer in this page: https://wiki.archlinux.org/index.php/Color_output_in_console

Mike McCabe
- 1,015
- 9
- 9