Skip to content

Instantly share code, notes, and snippets.

View mcchae's full-sized avatar

Jerry Chae mcchae

View GitHub Profile
@rgl
rgl / python-embedded.md
Last active March 18, 2024 15:33
notes about python embedded in windows

The gist is:

  1. install the normal python from python.org
  2. install everything into a venv
  3. copy the venv into python embed.

A raw example

unzip python-3.8.0-embed-amd64.zip
@mcchae
mcchae / google-map-search.py
Last active June 2, 2021 10:53
Some python selenium examples
#!/usr/bin/env python
################################################################################
import sys
from time import sleep
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@AlexSnet
AlexSnet / lame.py
Created October 7, 2014 07:12
Lame python bindings
#coding:utf-8
# from: http://z4none.me/2014/07/09/Python-%E4%B8%AD%E4%BD%BF%E7%94%A8-libmp3lame-%E8%BF%9B%E8%A1%8C-mp3-%E7%BC%96%E8%A7%A3%E7%A0%81/
import time
import ctypes
class LameEncoder():
def __init__(self, sample_rate, channel_count, bit_rate):
self.dll = ctypes.CDLL("libmp3lame.dll")
@shoveller
shoveller / gist:b4d2e1e6d33906f2a667
Created July 3, 2014 14:06
왜 파이썬 데코레이터를 만들때, @wraps어노테이션을 쓰는 것을 권장하는 걸까?
__author__ = 'artemr'
'''
왜 파이썬 데코레이터를 만들때, @wraps어노테이션을 쓰는 것을 권장하는 걸까?
이유인 즉슨, 데코레이터 내부에서 인자로 전달받은 함수가 익명함수 처럼 취급되어 버리므로 디버깅이 난해해지는 단점이 있었기 때문이다.
자세한 설명은 아래의 링크에 첨부되어 있다.
원본: http://artemrudenko.wordpress.com/2013/04/15/python-why-you-need-to-use-wraps-with-decorators/
사본: https://www.evernote.com/shard/s174/sh/78eaad5f-a8f2-4496-b984-e3385fb963c0/922d9ab4b5cd23ac7b85aab42536aa4f
'''
@namlook
namlook / myapp.py
Created May 25, 2011 12:36
flask, celery and global g
from flask import Flask
app = Flask(__name__)
from flaskext.celery import Celery
celery = Celery(app)
def process_global(glob_obj):
g.db = app.config['MONGO_DATABASE'] # get the unpickle-izable database
for k,v in glob_obj.iteritems():
#!/usr/bin/python
"""Yet another curses-based directory tree browser, in Python.
I thought I could use something like this for filename entry, kind of
like the old 4DOS 'select' command --- cd $(cursoutline.py). So you
navigate and hit Enter, and it exits and spits out the file you're on.
Originally from: http://lists.canonical.org/pipermail/kragen-hacks/2005-December/000424.html
Originally by: Kragen Sitaker