(Tldr at bottom since this is a ramble)I tried making a simple program to let me know when my internet connection came back online. It was supposed to do a “ping google.com” with a shibang, and if there was no output after 10 seconds, wait 30 seconds and loop again. If it did receive packets, then it would run a “figlet online” in the terminal and exit. Super simple, but I don’t know how to capture or interpret shell output in a python script and it was also not displaying any of the command outputs in my terminal. Sorry if this is rambly Tldr: how do I run shell, capture shell output as a variable, and run commands who’s output is visible in the terminal.
submitted by /u/Popular-Spirit1306
[link] [comments]
r/learnpython (Tldr at bottom since this is a ramble)I tried making a simple program to let me know when my internet connection came back online. It was supposed to do a “ping google.com” with a shibang, and if there was no output after 10 seconds, wait 30 seconds and loop again. If it did receive packets, then it would run a “figlet online” in the terminal and exit. Super simple, but I don’t know how to capture or interpret shell output in a python script and it was also not displaying any of the command outputs in my terminal. Sorry if this is rambly Tldr: how do I run shell, capture shell output as a variable, and run commands who’s output is visible in the terminal. submitted by /u/Popular-Spirit1306 [link] [comments]
(Tldr at bottom since this is a ramble)I tried making a simple program to let me know when my internet connection came back online. It was supposed to do a “ping google.com” with a shibang, and if there was no output after 10 seconds, wait 30 seconds and loop again. If it did receive packets, then it would run a “figlet online” in the terminal and exit. Super simple, but I don’t know how to capture or interpret shell output in a python script and it was also not displaying any of the command outputs in my terminal. Sorry if this is rambly Tldr: how do I run shell, capture shell output as a variable, and run commands who’s output is visible in the terminal.
submitted by /u/Popular-Spirit1306
[link] [comments]