This file contains hidden or 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
| # Solution one | |
| a='AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz' | |
| t=input().replace(' ','') | |
| x = [c for c in t if not c.isalpha()] | |
| b = [c for c in t if c.isalpha()] | |
| s = sorted(b,key=lambda c:a.index(c)) | |
This file contains hidden or 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
| # This gist aims to check the parentheses and brackets in a mathematical expression like "((2+3)*[5**2+1])*(40+2)". | |
| import sys | |
| import math | |
| t = input() | |
| s = [] | |
| for c in t: | |
| if c in ("(", "[", "{"): |
This file contains hidden or 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
| from PIL import Image | |
| def split(path, input, height, width): | |
| im = Image.open(input) | |
| k = 0 | |
| imgwidth, imgheight = im.size | |
| for i in range(0,imgheight,height): | |
| for j in range(0,imgwidth,width): | |
| box = (j, i, j+width, i+height) | |
| a = im.crop(box) |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| #!/usr/bin/env python | |
| """ | |
| A script designed to | |
| 1) resize all of the downloaded images to desired dimension (DEFAULT 64x64 pixels) and | |
| 2) rename images in folders from 1.png to n.png for ease of use in training | |
| Modified version from https://github.com/rkjones4/GANGogh/blob/master/misc/picStuff.py | |
| """ |