Last active
February 1, 2022 08:52
-
-
Save Keycatowo/72099b890f023c3f369f81f390bbf4cc to your computer and use it in GitHub Desktop.
根據url取得圖片並顯示
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 根據url取得圖片並顯示 | |
import requests | |
from PIL import Image | |
import matplotlib.pyplot as plt | |
response = requests.get(target_url) | |
img = Image.open(BytesIO(response.content)) # 將圖片Bytes轉換成檔案開啟 | |
plt.imshow(img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment