Back

Sanskar

Keen Learner and Exp... • 22d

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 • 11m

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... • 8m

🔮 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

Comet

#freelancer • 8m

Extract favorite scenes from YouTube videos YTCutter is a single tool with multiple purposes. Perhaps you don't want to download a full YouTube video; you might only need a small clip. With it, you can select the portion that you need and just downl

See More
Reply
2
Image Description

IMDADULLAH HUSSAINI

Hey I am on Medial • 8m

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
Image Description
Image Description

SHIV DIXIT

CHAIRMAN - BITEX IND... • 1y

If someone make an ai who help people to download anything on internet even if that thing is paid or free then it will be next boom. Like course , software , tools , games , movies , and anything just write the name of that thing and your downloadin

See More
3 Replies
8

Comet

#freelancer • 7m

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

Sanskar

Keen Learner and Exp... • 21d

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
Image Description

Sarthak Gupta

17 | Founder of Styl... • 6m

Did you know that you will now be able to code using python on mobile all thanks to Blaze IDE. Download the app now from play store.

1 Reply
2

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