Skip to content

Instantly share code, notes, and snippets.

View KeyleXiao's full-sized avatar
🤒
Out sick

Keyle Xiao KeyleXiao

🤒
Out sick
View GitHub Profile
@KeyleXiao
KeyleXiao / img_download.py
Created April 24, 2024 02:21
use python download img from url
# -*- coding: utf-8 -*-
import requests
import os
from datetime import datetime
import sys
def download_and_save_image(url, directory,image_formate):
# 获取当前日期和时间,用于命名文件
now = datetime.now()
filename = now.strftime("%Y-%m-%d-%H-%M-%S.") + image_formate