Aug 24, 2020 10:45 AM
(This post was last modified: Aug 24, 2020 10:53 AM by 0u1law.)
hey guys
i want to write a programm which can do multiple tasks at once with multiprocessing/asyncio. but i dont know how to give the output of the code in 2 or 3 cmds just for organizing and clear overview.
my intention is to download some images from specific website over a long period of time. the output for every downloaded picture is like "pic1.jpg done" "pic2.jpg done" and so on. and at the other side i want to check the internet connection permanently so if the connection gets interrupted i can stop my main program and wait until the connection ist established again!
which modules do i need for that kind of intention ?
and just by the way im tying to use the ping command with python like this :
how can i read the output and check every single time the pingtime? something like this
PSEUDOCODE
if there are other ways(im sure there is) which is more efficient or a better solution for a newbie please tell me.
thanks a lot
0u1law
i want to write a programm which can do multiple tasks at once with multiprocessing/asyncio. but i dont know how to give the output of the code in 2 or 3 cmds just for organizing and clear overview.
my intention is to download some images from specific website over a long period of time. the output for every downloaded picture is like "pic1.jpg done" "pic2.jpg done" and so on. and at the other side i want to check the internet connection permanently so if the connection gets interrupted i can stop my main program and wait until the connection ist established again!
which modules do i need for that kind of intention ?
and just by the way im tying to use the ping command with python like this :
Code
process = subprocess.Popen("ping -t www.google.com")how can i read the output and check every single time the pingtime? something like this
PSEUDOCODE
Code
while True:
------for line in process:
------------if milliseconds > 1000 or no_milliseconds_shown:
-----------------wait main program
------------else:
----------------passif there are other ways(im sure there is) which is more efficient or a better solution for a newbie please tell me.
thanks a lot
0u1law



![[Image: VgXWA2P.png]](https://i.imgur.com/VgXWA2P.png)