Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

[Source] Random image downloader by size

Hey! I've been practicing python and messing around with APIs. This script will download the number of images you want based on the size you declare using Lorem Picsum.

[Image: 960ef4764b1a698f9b2047eaecd1acbc.png]

I added a lot of comments incase you are learning as well.

Source CodeSpoiler (Click to View)

I also converted it to an EXE using pyinstaller which makes it easier to run but virustotal thinks its a virus so I won't upload lmao

Thanks (:
Tiny improvement you could make to your code
instead of using i to define your numbers in the files, you could simply just use the variable in your for range() loop

and instead of converting your count to an int after the function, you can change the function to
Code
def getimg(width: int, height: int, count: int):

this will ensure that your variables are integers when your function starts
I did a little project similar to this however I was using a public anime image API aha
(Dec 13, 2021 01:58 PM)Akumi Wrote:  I did a little project similar to this however I was using a public anime image API aha

I love APIs lol


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by jj89XDJun 2, 2026 03:58 AM 2 1,496 Jun 2, 2026 03:58 AM
Last Post: palmer_style2009
[Python] by CryptAug 15, 2020 02:09 AM 1 115 Aug 15, 2020 02:09 AM
Last Post: Majin Goten
[C#] by C++Dec 29, 2019 06:16 PM 16 830 Dec 29, 2019 06:16 PM
Last Post: DNA