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
| # -*- coding: utf-8 -*- | |
| """ | |
| Collage maker - tool to create picture collages | |
| Author: Delimitry | |
| """ | |
| import time | |
| import argparse | |
| import os | |
| import random | |
| from PIL import Image |
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
| import sqlite3 | |
| import os.path | |
| from os import listdir, getcwd | |
| from IPython.core.display import Image | |
| def getImage_list(rel_path): | |
| abs_path = os.path.join(os.getcwd(),rel_path) | |
| print 'abs_path =', abs_path | |
| dir_files = os.listdir(abs_path) | |
| return dir_files |
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
| def dbread(): | |
| import sqlite3 | |
| conn = sqlite3.connect('XPfts4.db') | |
| c = conn.cursor() | |
| count = 0 | |
| req = 100 | |
| view = raw_input("Search : ") | |
| for row in c.execute('SELECT rowid, code FROM pages WHERE pages MATCH ?', (view,)): | |
| count=count+1 | |
| print (row)[0],"-",(row)[1],"\n" |
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
| import sqlite3 | |
| import os.path | |
| from os import listdir, getcwd | |
| from IPython.core.display import Image | |
| def get_picture_list(rel_path): | |
| abs_path = os.path.join(os.getcwd(),rel_path) | |
| print 'abs_path =', abs_path | |
| dir_files = os.listdir(abs_path) | |
| return dir_files |
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
| import os | |
| from time import sleep | |
| import sqlite3 | |
| import os, requests, sys, json | |
| import GISTkey | |
| username=GISTkey.gistkey()[0] | |
| password=GISTkey.gistkey()[1] | |
| database ="GISTstore/gist.db" | |
| conn = sqlite3.connect(database) | |
| c = conn.cursor() |
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
| # USE: | |
| #import GISTkey | |
| #username=GISTkey.gistkey()[0] | |
| #password=GISTkey.gistkey()[1] | |
| def gistkey(): | |
| username='username' | |
| password="password" | |
| GistAPI = (username, password) | |
| return GistAPI |
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/python | |
| #USE: python SimpleGistPost.py FileToPost.py | |
| import os, requests, sys, json | |
| import GISTkey | |
| from time import sleep | |
| username=GISTkey.gistkey()[0] | |
| password=GISTkey.gistkey()[1] | |
| filename = os.path.basename(sys.argv[1]) | |
| content=open(filename, 'r').read() | |
| r = requests.post('https://api.github.com/gists',json.dumps({'files':{filename:{"content":content}}}),auth=requests.auth.HTTPBasicAuth(username, password)) |
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
| import pyglet | |
| def exit_callback(dt): | |
| pyglet.app.exit() | |
| return | |
| def pmp3(mp3File): | |
| music = pyglet.media.load(mp3File) | |
| music.play() | |
| pyglet.clock.schedule_once(exit_callback , music.duration) | |
| pyglet.app.run() | |
| return |
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
| # USAGE example: | |
| # import UnCamel | |
| # x = "TimeToUncamelCaseTextUsingFunctions" | |
| # UnCamel.uncamel(x) | |
| def uncamel(x): | |
| return reduce(lambda a,b: a + ((b.upper() == b and (len(a) and a[-1].upper() != a[-1])) | |
| and (' ' + b) or b), x, '') | |
| def uncam(x): | |
| import re | |
| return re.sub("([a-z])([A-Z])","\g<1> \g<2>",x) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.