- 浏览: 70347 次
- 性别:
- 来自: 杭州
-
最新评论
-
mlzboy:
博主,有没有im或是email的方式,想向您请教一下super ...
supervisor 管理后台进程
文章列表
ffmpeg -formats 显示支持的格式
ffmpeg -i 视频文件 显示文件信息
Virtualenv 簡單入門 (转载)
- 博客分类:
- python
转载自 http://blog.gasolin.idv.tw/2010/02/virtualenv.html
Virtualenv 簡單入門
功用
使用 Virtualenv 可以讓你預先建立一個虛擬環境,在虛擬環境中開發 Python 程式,可以保持 Python path 乾淨,並減少因為機器上需要同時支援不同版本函式庫,造 ...
mysql tips
- 博客分类:
- 默认类别
删除重复项
http://aiyooyoo.com/index.php/archives/357/
mac os 安装 gun core utils
- 博客分类:
- 默认类别
mac上的ls不支持 --ignore 选项
解决方法:
brew install coreutils
然后在 .bash_profie 添加
alias ls="gls --color --ignore='*.pyc'"
1 需要帐号的 access key
2 我采用了python的库 https://github.com/pankratiev/python-amazon-ses-api
具体代码如下
第一步
verify你的发出邮件:
from amazon_ses import AmazonSES, EmailMessage
AccessKeyID = ...你的AccessKeyID
SecretAccessKey = ...你的SecretAccessKey
amazonSes = AmazonSES(AccessKeyID, SecretAccessKey)
amazonSes.veri ...
python redis note
- 博客分类:
- python
import redis
r = redis.Redis()
查看所有keys
r.keys()
or
r.keys('*')
删除所有key
names = r.keys()
r.delete(names)
查看key的type
r.type(key)
redis 文档中文翻译
http://redis.readthedocs.org/en/latest/index.html
pyres 后台队列
- 博客分类:
- python
pyres 是一个后台消息调控队列
1 失败重试
retry_every 每隔多少时间retry
retry_timeout 整个retry过程最多用时
2 指定时间的任务
enqueue_at(a, ...)
a是一个datetime类变量,其他的和enqueue一样
3 参数必须是 JSON serializable, so 传递个函数就不行
not JSON serializable
python 包管理note
- 博客分类:
- python
1 python setup.py develop
开发模式:创建链接到当前文件夹,你修改源码,立刻反应出来
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="jquery-1.5.1.min.js">
</script>
<script type="text/javascript" >
$(function(){
alert('hello world' ...
1 mac 安装
brew install mongodb
查看安装的文件 brew list mongodb
2 新建数据dir
sudo mkdir -p /data/db
3 启动
server: sudo mongod
client shell: sudo mongo
4 pymongo
http://superuser.com/questions/121407/python-easy-install-confused-on-mac-os-x
easy_install -U setuptools
python -m easy_install pymongo
参照此文
http://www.onepie.org/2010/03/09/application-autostart-at-boot-time-on-ubuntu/
采用了第一种方法
需要注意
1 需要让bash成为默认的 sudo dpkg-reconfigure dash
2 把/usr/local/bin 加入path
3 以普通用户执行 sudo -u username 执行程序
0 安装
sudo add-apt-repository ppa:uwsgi/release
http://www.zhimaq.com/questions/1151/uwsgi
1 uwsgi 的process 接收的信号
http://projects.unbit.it/uwsgi/wiki/uWSGISignals
修改代码候,重新载入 kill -HUP pid
关闭uwsgi kill -QUIT pid
2 django管理界面
uwsgi自带一个django的管理界面,比较简单,可以看统计、和重启uwsgi进程
sudo easy_install django-uwsgi- ...
mac上
装 sudo port install erlang
shell:
erl
快速启动一个计算 n!的例子
http://www.erlang.org/quick_start.html
http://wiki.python.org/moin/WorkingWithTime
1 三种数据格式:
seconds:float
tuple
string
2 数据转化
3
In [17]: datetime.datetime.fromtimestamp(time.time())
Out[17]: datetime.datetime(2012, 11, 15, 21, 19, 10, 639881)
http://simononsoftware.com/virtualenv-tutorial/