You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
622 B
26 lines
622 B
#!/usr/bin/env python3
|
|
|
|
import string
|
|
import numpy as np
|
|
from PIL import Image
|
|
import urllib.request
|
|
from io import BytesIO
|
|
|
|
def cat(w, h):
|
|
url = f'https://cataas.com/cat/width={w}?height={h}?text=cat'
|
|
resp = urllib.request.urlopen(url)
|
|
im_data = resp.read()
|
|
im = Image.open(BytesIO(im_data))
|
|
return im
|
|
|
|
def cat_says(text,w, h):
|
|
url = f'https://cataas.com/cat/says/{text}?size=100&width={w}?height={h}?text=cat'
|
|
resp = urllib.request.urlopen(url)
|
|
im_data = resp.read()
|
|
im = Image.open(BytesIO(im_data))
|
|
return im
|
|
|
|
if __name__ == "__main__":
|
|
cat = cat(1920,1080)
|
|
cat.show()
|
|
|
|
|