Skip to main content
deleted 1 character in body
Source Link
LyricLy
  • 3.7k
  • 2
  • 20
  • 40

Python 3 + Requests + PIL, 192192 186 bytes

from requests import* import PIL.Image as f from io import* r=get("https://xkcd.com/%s/info.0.json"%input()).json() f.open(BytesIO(get(r["img"], stream=1).content)).show() print(r["alt"]) 

Opens up an image viewer (whichever is default on the system it's being run on) containing the comic, and posts the title text to the console.

Python 3 + Requests + PIL, 192 bytes

from requests import* import PIL.Image as f from io import* r=get("https://xkcd.com/%s/info.0.json"%input()).json() f.open(BytesIO(get(r["img"], stream=1).content)).show() print(r["alt"]) 

Opens up an image viewer (whichever is default on the system it's being run on) containing the comic, and posts the title text to the console.

Python 3 + Requests + PIL, 192 186 bytes

from requests import* import PIL.Image as f from io import* r=get("https://xkcd.com/%s/info.0.json"%input()).json() f.open(BytesIO(get(r["img"],stream=1).content)).show() print(r["alt"]) 

Opens up an image viewer (whichever is default on the system it's being run on) containing the comic, and posts the title text to the console.

Source Link
LyricLy
  • 3.7k
  • 2
  • 20
  • 40

Python 3 + Requests + PIL, 192 bytes

from requests import* import PIL.Image as f from io import* r=get("https://xkcd.com/%s/info.0.json"%input()).json() f.open(BytesIO(get(r["img"], stream=1).content)).show() print(r["alt"]) 

Opens up an image viewer (whichever is default on the system it's being run on) containing the comic, and posts the title text to the console.