We then can use the array of methods to interact with the internet. To use the request package we have to import the requests module. I will come back to this point in later articles! Introduction to the Request package This is a complex topic but can make a difference in the efficiency of your python scripts. The asynchronous packages are useful when you have a large number of HTTP requests to make. I use the requests package as it’s readable and will be able to manage most HTTP requests that you would need to make anyways. The url-lib and url-lib2 packages have a lot of boilerplate and can be a little unreadable at times. This allows scaling 1000’s of requests with ease. Seems efficient to me!Īsynchronous requests don’t block the browser, this allows the client to do other tasks at the same time. This means there are times when the CPU is doing nothing and can waste computation time. Synchronous request blocks the client (the browser) until the operation is complete. You may ask what is the difference between synchronous and asynchronous requests? Why is this important?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |