Skip to content

Instantly share code, notes, and snippets.

View littmus's full-sized avatar

Dongwon Shin littmus

View GitHub Profile
사귀 ㄴ지 얼마나 되 었 어 ?
None
3 년
None
헉 ! ! ! !
Sorry
생각 하 았 던 것 보단 심각 하 ㄴ 사 이 겠 군 ~
None
글 하 지 , 사람 은 자기 인연 을 알 아 로 보 는 것 이 ㄹ까 ?
None
E4
C5
G4
B1
D7
C1
D5
B2
D4
@littmus
littmus / header.py
Last active November 3, 2015 10:21
try:
import httplib
except:
import http.client as httplib
try:
import urllib
urllib.urlencode({})
except:
import urllib.parse as urllib
import os
from distutils.sysconfig import get_python_lib
from pip import get_installed_distributions
def get_locally_installed_packages():
path = get_python_lib()
packages = {}
for root, dirs, files in os.walk(path):
for item in files:
if "top_level" in item:
from collections import OrderedDict, defaultdict
class _OrderedDefaultDict(OrderedDict, defaultdict):
pass
class OrderedDefaultDict(_OrderedDefaultDict):
def __init__(self, default_factory=None, **kwargs):
#!/usr/bin/env python
import bs4
import requests
import time
def main():
r = requests.get("http://www.caffebene.co.kr/sub03/searchStore/map")
b = bs4.BeautifulSoup(r.text)
sido_data = b.find_all("map", id="Map")[0].find_all("area")
@littmus
littmus / flamingo.py
Created July 29, 2014 07:28
Simple image uploading and serving app using Flask
from flask import Flask, request, redirect, send_file
from werkzeug.utils import secure_filename
import os
import imghdr
ALLOWED_EXTENSIONS = set(['jpg', 'png', 'jpeg', 'gif'])
UPLOAD_PATH = './image'
app = Flask(__name__)
app.config['UPLOAD_PATH'] = UPLOAD_PATH
@littmus
littmus / ppt2png.py
Last active March 27, 2024 14:58
Python snippet for converting ppt/pptx file to png files. Works only in PowerPoint installed Windows!
import sys
import os
try:
from comtypes import client
except:
print "Install comtypes from http://sourceforge.net/projects/comtypes/"
sys.exit(-1)
if __name__ == '__main__':