移植自 Dant 的 FlvPatcher [http://danknest.org]
> https://github.com/dantmnf/FlvPatcher/blob/master/blacker.sh
于 Linux Mint 16 下测试通过。
sudo apt-get install libav-tools ffmsindex mkvtoolnix mediainfo nodejs && npm install sequence
移植自 Dant 的 FlvPatcher [http://danknest.org]
> https://github.com/dantmnf/FlvPatcher/blob/master/blacker.sh
于 Linux Mint 16 下测试通过。
sudo apt-get install libav-tools ffmsindex mkvtoolnix mediainfo nodejs && npm install sequence
# coding=utf8 | |
import PIL | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200): | |
REPLACEMENT_CHARACTER = u'\uFFFD' | |
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' ' |
#!/usr/bin/python | |
# The urlparse module provides functions for breaking URLs down into their | |
# component parts, as defined by the relevant RFCs. | |
from urlparse import urlparse | |
# PARSING | |
parsed = urlparse('http://user:pass@NetLoc:80/path;parameters?query=argument#fragment') |
#coding=utf-8 | |
import time | |
import sched | |
import os | |
import threading | |
""" | |
sched模块,准确的说,它是一个调度(延时处理机制),每次想要定时执行某任务都必须写入一个调度。 | |
使用步骤如下: | |
(1)生成调度器: | |
s = sched.scheduler(time.time,time.sleep) |
r""" | |
sqlassist | |
~~~~~~~~~ | |
v0.3 | |
sections of code taken from : | |
- Mike Orr's package 'sqlahelper' | |
- Mike Bayer's blog post 'Django-style Database Routers in SQLAlchemy' | |
#!/usr/bin/env python | |
# | |
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. | |
# | |
# Permission to use, copy, modify, and distribute this software and its | |
# documentation for any purpose and without fee is hereby granted, | |
# provided that the above copyright notice appear in all copies and that | |
# both that copyright notice and this permission notice appear in | |
# supporting documentation, and that the name of Vinay Sajip | |
# not be used in advertising or publicity pertaining to distribution |
#用正则简单过滤html的<>标签 | |
import re | |
str = "<img /><a>srcd</a>hello</br><br/>" | |
str = re.sub(r'</?\w+[^>]*>','',str) | |
print str |