Quantcast
Viewing all articles
Browse latest Browse all 14069

mad mode "wb" error when trying to download an icon from a url [closed]

ane example url of an icon i want to download

example_url = ["https://raw.githubusercontent.com/ivoxprojects/eztools/main/icons/home-dark.png"]

Loop through all the urls and if one image is missing download it

 appdata = getenv("APPDATA") +"\\path"    for url in urls:        name = url.split("/")[-1]        if name not in listdir(appdata):            print("Missing > " + name)            response = requests.get(url, allow_redirects=True)            if response.status_code == 200:                try:                    with open(f"{appdata}\\{name}", "wb") as file:                        file.write(response.content)                except Exception as ex:                    print(ex)

Viewing all articles
Browse latest Browse all 14069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>