Thanks Johan. I want to ask why you placed the 'if __name__=="__main__" ' statement within the context manager and not the other way. I can see there plenty "finished in time :" lines printed in the video. Meanwhile, I tried it the other way by placing the 'if __name__=="__main__" ' statement above and outside the context manager, I got expected result, less print outputs. Is there any particular reason you did it that way?
Thank you for your great video ,!! I'd like to see a tuto of futures trading python of crossing two ema with taking profit targets . I 'm really stucked with functions and logics of taking profits with futures . I made a lot of research in the net but i didn't find much information . Please if possible explain it in a tutorial for your future videos . Thank you master
some one explain me how i can stop a program in running time like we say alexa what news today the she say first news,2 news, 3 news but at time program is live running then we say stop program program is stop how ? plss explain
def test(num): time.sleep(num) return "hello" start = time.time() with concurrent.futures.ProcessPoolExecutor() as executor: if __name__ == "__main__": f1 = executor.submit(test, 1) f2 = executor.submit(test, 1)
print(time.time() - start) This is the code I used it's taking a little bit more than 14 seconds to execute where as on the cpu it took 2 second. Can you please help me and point out the mistake if there any ?
Why FInished in time is printed so many times?
time.perf_counter() doing it
Nice vid, what I needed.
Thanks:)
Good one...
Thanks :))
How do you make it stop running the rest of the script until the futures are done running?
debugging such code is a nightmare
Thanks Johan. I want to ask why you placed the 'if __name__=="__main__" ' statement within the context manager and not the other way. I can see there plenty "finished in time :" lines printed in the video. Meanwhile, I tried it the other way by placing the 'if __name__=="__main__" ' statement above and outside the context manager, I got expected result, less print outputs. Is there any particular reason you did it that way?
Yeah seems really weird. Since when is name==main a requirement anywhere?
Thank you for your great video ,!! I'd like to see a tuto of futures trading python of crossing two ema with taking profit targets . I 'm really stucked with functions and logics of taking profits with futures . I made a lot of research in the net but i didn't find much information . Please if possible explain it in a tutorial for your future videos . Thank you master
Is there a way to pass in multiple arguments to that submit function call?
You can pass all arguments declared in the function definition, separated with commas.
Great video! Although your link to the code doesn’t work anymore.
some one explain me how i can stop a program in running time like we say alexa what news today the she say first news,2 news, 3 news but at time program is live running then we say stop program program is stop how ? plss explain
how to run multiple selenium driver python script one by one in python
def test(num):
time.sleep(num)
return "hello"
start = time.time()
with concurrent.futures.ProcessPoolExecutor() as executor:
if __name__ == "__main__":
f1 = executor.submit(test, 1)
f2 = executor.submit(test, 1)
print(time.time() - start)
This is the code I used it's taking a little bit more than 14 seconds to execute where as on the cpu it took 2 second. Can you please help me and point out the mistake if there any ?
You did not call the test function so please check that.
The photo of your pc
Photo in tamr Tg channel