Getting Started with asyncio and Python

  Рет қаралды 49,959

TutorialEdge

7 жыл бұрын

👨‍💻 For the price of a ☕ every month, sign up and gain access to a growing list of premium courses on my site - tutorialedge.net/pricing/ 👩‍💻
● SUBSCRIBE to see more of my Videos & hit that LIKE button to support the channel!
Hi All, in this tutorial we are going to be taking a look at the asyncio library and how you can use this to create concurrent, high-performance Python based applications.
We'll be covering coroutines and how you can schedule numerous coroutines within the framework.
‎● My Twitter ► ⁦‪ Elliot_f
‎● My Website ► tutorialedge.net
‎--------------
🎥 Recording Setup
Microphone - amzn.to/3hvASys
Mic Boom - amzn.to/3o0cW8Q
Mouse - amzn.to/2WZMoZs
Monitor 1 - amzn.to/38IUlYy
Monitor 2 - amzn.to/3rBTZf7
Mount - amzn.to/3o3185V
USB-C Hub - amzn.to/3o2xRbw

Пікірлер: 35
@kobas8361
@kobas8361 5 жыл бұрын
Man, these series are just so AWESOME, comprehensive and as in depth as I'd wish! Great job
@tryagain622
@tryagain622 4 жыл бұрын
RIP bro
@gemcoin
@gemcoin 3 жыл бұрын
Great job. “It is very simple to be happy, but it is very difficult to be simple.” Tagore
@kitgary
@kitgary 4 жыл бұрын
I heard that asyncio is not multiprocessing, it only provides concurrency but not parallelism, am I right?
@Pheonixrocks
@Pheonixrocks 3 жыл бұрын
that typing speed tho, loving it
@carnaciousG
@carnaciousG 3 жыл бұрын
Shouldn't we use "asyncio.run(main())" instead of the 3 loop lines as suggested here : docs.python.org/3/library/asyncio-eventloop.html ?
@hunterpruett5455
@hunterpruett5455 4 жыл бұрын
Feedback: I feel like you didn't go too fast, but you didn't really explain too much about what each and every bit of code means. I came here because I am absolutely clueless about how asyncio works, and you probably understand it very well, but in your videos, I suggest overexplaining everything for us people who are learning from scratch.
@abdulzz97
@abdulzz97 3 жыл бұрын
true. thats why i dislike this video. hoping that someone will upload bout what exactly is a coroutine. i cant understand
@arnonaf
@arnonaf 5 жыл бұрын
How can you properly integrate it with aiohttp web application listener? So when you route url to function handler, the handler itself will be generated as a non blocking task in the asyncio event loop? I made it work by making the writing the handler as a wrapper to the original function, meaning the handler now unpack the input data of the https request and adds it to a task using run_in_executor, and calling asyncio.wait. Even though it works I'm not sure if it is the right/best way, because the original blocking function had to be single threaded, if it had async def... and await in it, it just wouldn't get executed. For example if this function has a heavy process and it sends the results to another https server, I had to used requests.post, instead of aiohttp ClientSession which is async method. Also, I wan't sure where exactly I should close the loop itself, because it cannot be done in the handler.
@tornyu
@tornyu 6 жыл бұрын
Very nice, thanks. Next time could you please make the font bigger? It was a bit hard to read on my phone.
@Tutorialedge
@Tutorialedge 6 жыл бұрын
I've started increasing the fonts on my latest videos, hopefully this is big enough! :)
@raggedclawstarcraft6562
@raggedclawstarcraft6562 5 жыл бұрын
@@Tutorialedge or just capture part of the screen. in this particular example the right side of the screen were mostly empty.
@pynchia4119
@pynchia4119 5 жыл бұрын
Why do you need to call ensure_future and not the coroutine directly
@nomad27
@nomad27 4 жыл бұрын
Thanks for this. Great tutorial + love your accent!
@georgesmith3022
@georgesmith3022 5 жыл бұрын
simple and clear, thanks
@elliottharris4526
@elliottharris4526 5 жыл бұрын
I ran code as above (except called sublime py file from command line) and got Runtime warning coroutine 'main' was never awaited. --- Apparently one doesn't need all the loop set up and just does asyncio.run(main()) instead. Version thing I guess.
@xyy9xx
@xyy9xx 6 жыл бұрын
Great video. but could you please tell me which extension for showing file name & file type?
@Zzzzzzzzzzzzzzzzzzzzr
@Zzzzzzzzzzzzzzzzzzzzr 6 жыл бұрын
So this slows everything to run at once as in your function or requests?
@impossibruh6969
@impossibruh6969 6 жыл бұрын
Fucking hell I love your accent lol
@ahmeterdem9312
@ahmeterdem9312 5 жыл бұрын
Do you know which part of the UK, should I move to acquire this kind of accent?
@atxweirdo
@atxweirdo 7 жыл бұрын
Great video, will there be more videos showing advanced features of async?
@Tutorialedge
@Tutorialedge 7 жыл бұрын
+atxweirdo thank you! I will indeed be covering asyncio in more depth in the near future so stay tuned!
@tron_sa
@tron_sa 4 жыл бұрын
thanks, Great Job, I could understand immediately
@prafulkumawat
@prafulkumawat 6 жыл бұрын
Sorry! But which editor you are using...
@Tutorialedge
@Tutorialedge 6 жыл бұрын
Visual Studio Code :)
@ahm_8483
@ahm_8483 6 жыл бұрын
What is ur theme, or/and font? thnx
@prafulkumawat
@prafulkumawat 6 жыл бұрын
@@Tutorialedge thanx
@executeOrder69
@executeOrder69 5 жыл бұрын
Very helpful! Thank you! :D
@phb17
@phb17 6 жыл бұрын
Hey there! Thanks for the great tutorial! I'm new to Python and I tried your code and it works like a charm, but when I replace "await asyncio.sleep(process_time)" by let's say for instance a very time consuming for loop (for i in rand(10000, 1000000)) it just run synchronously. I've tried many things and asyncio.sleep() is the only thing I can make work so far :(
@AbhishekNigam
@AbhishekNigam 5 жыл бұрын
Explained well!
@zenberryone
@zenberryone 5 жыл бұрын
That was very helpful! Thanks a lot! Guys, the code is here: tutorialedge.net/python/concurrency/getting-started-with-asyncio-python/
@abdulzz97
@abdulzz97 3 жыл бұрын
what is exactly coroutine? you just teaching them expert and savvy. not us beginners. just straight coding without a simple brief (for example you explain how we beginner do things that could be turned into coroutine). so 1 dislike from me pal. sorry this just confusing for me
@aharongina5226
@aharongina5226 4 жыл бұрын
nice video, but asyncio is useless
@princessluna3953
@princessluna3953 5 жыл бұрын
This tutorial is such a pain its so small
@EnitinEnitin
@EnitinEnitin 5 жыл бұрын
You don't explain anything.
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 53 МЛН
Миллионер | 2 - серия
16:04
Million Show
Рет қаралды 1,3 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 53 МЛН