Back

Sanskar

Keen Learner and Exp... • 2d

Day 23 of learning python as a beginner. Topic: multi-threading. Multi-threading is a technique to run multiple task (such as importing or downloading) within a single program and at the same time. Thus running multiple things parallelly, in a nutshell. Although you can use threading to download anything I practiced it for downloading images from the internet (pexels to be specific). I used multiple for loops first for appending the image_urls list from the inputs I am taking from my user. Then I am using another for loop with enumerate so that each url link in the list gets downloaded and threading.Thread sends this data to my download_image() function with all the related arguments necessary to download the image and and create a unique file. Just like calling functions and classes you need to use .start() function in order to start the threading process. and then use .join() function so that the program waits for both the images to get downloaded completely and then continues to execute the remaining code. Here's my code and its result and I would love to hear your all's amazing suggestion to my code.

Reply
2

More like this

Recommendations from Medial

Sidharth Bidikar

Keep Moving • 10m

What is the most efficient way to combine text from multiple cells into one cell without using the CONCATENATE function? A) Using the TEXTJOIN function B) Using the LEFT function C) Using the SUBSTITUTE function #excel #msexcel #dataanalyst #dataan

See More
Reply
1
5

Amit Soni

A billion dollar dre... • 7m

🔮 No-Code AI Revolution: Multi-Agent Systems for Everyone! Multimodal LLM-based multi-agent systems are now accessible through no-code platforms. Game-changer alert! 🚀 Why it matters: - Non-technical teams can implement complex AI - Handle text,

See More
Reply
2
2
Image Description

Inayat Hasan

Software engineer • 1y

[This post has been deleted by the creator]

1 Reply
4

Sanskar

Keen Learner and Exp... • 1d

Day 24 of learning python as a beginner. Topic: decorators Somebody has suggested me that I should focus on some of the important things and he gave me a list of topics to learn. Decorators were at very top of that list and therefore I decided to l

See More
Reply
1

Suraj Dusane

Hey I am on Medial • 1y

How I Complete My 5-Day Boring Task in Less Than Half an Hour👇🏻 1. Eureka Moment: So, I was stuck making PowerPoint slides manually, which was a real pain. Then, I had this genius idea to make things easier by automating the whole process. 2. Hun

See More
Reply
9

Kalash

21. Curious, optimis... • 4m

If I create a SaaS with its boilerplate on GitHub and grant paying customers collaborator access, what prevents a user from downloading the code as a ZIP file and sharing it for free? This could ruin my business 🥹 any solutions, such as a legal

See More
Reply
3
Image Description
Image Description

Parth Chavan

Owner of Thynk Media... • 4m

If I am building an application. What will I need to add the OTP function to my application??

4 Replies
1
7
Image Description

IMDADULLAH HUSSAINI

Hey I am on Medial • 7m

want to generate food code like otp for food delivery company in which locked food item would open only when code inter in delevery person's mobile and food code will get person only who ordered food by this function we can given food protection from

See More
1 Reply

Comet

#freelancer • 6m

Alibaba has introduced a new free neural network called Qwen2.5-Max, claiming it surpasses the well-known DeepSeek V3 and GPT-4o. Key features include: - Code writing and internet search capabilities - Generation of photorealistic images - High-qual

See More
Reply
3

Download the medial app to read full posts, comements and news.