Pycoder’s Weekly

搜罗Py万物 的周刊

亲, 大家多分享文章 俺们才折腾的出又一周的美好呢. 喜欢就 在 Gratipay 支持俺们吧! 当然的,俺们也在twitter

新闻

讨论

python3 -m http.server python -m SimpleHTTPServer 最方便内置 邮件 发送: python -m smtpd -c DebuggingServer -n 俺在哪儿: from os.path import expanduser home_dir = expanduser(’~’) 丫在哪儿: cdp () { cd “$(python -c “import os.path as , ${1};
print(
.dirname(_.realpath(${1}.file[:-1])))” )” } ~ $ cdp os /usr/lib/python2.7 $ ~ $ cdp os.path /usr/lib/python2.7 $ 人性化排序: »> from distutils.version import StrictVersion »> versions = [‘1.3.12’, ‘1.3.3’, ‘1.2.5’, ‘1.2.15’, ‘1.2.3’, ‘1.2.1’] »> versions.sort(key=StrictVersion) »> print versions [‘1.2.1’, ‘1.2.3’, ‘1.2.5’, ‘1.2.15’, ‘1.3.3’, ‘1.3.12’] »> l = [‘v1.3.12’, ‘v1.3.3’, ‘v1.2.5’, ‘v1.2.15’, ‘v1.2.3’, ‘v1.2.1’] »> l.sort(key=LooseVersion) »> l [‘v1.2.1’, ‘v1.2.3’, ‘v1.2.5’, ‘v1.2.15’, ‘v1.3.3’, ‘v1.3.12’] 终端真数学: $ pmath ‘3 + 4’ 7 $ pmath -f’.4f’ ‘pow(2000, 1/3)’ 12.5992 $ pmath -f’.4f’ ‘sin(pi/2)’ 1.0000 $ pmath -c ’exp(1j*pi).real’ -1.0 $ pmath ‘x=3;x+2’ 5 $ echo ‘3+4’ | pmath 7 最方便合成器: ‘’.join(itertools.islice(handle, lines)) 最方便 实时分析: import pdb; pdb.set_trace() or in IPython: import ipdb; ipdb.set_trace() … )

工作

项目

  • python-flamegraph 能输出 FlameGraph 兼容的剖析统计数据. github.com Shared by @myusuf3 (是也乎: 简单的说, Python 运行时也能用 火焰图来观察了! python-flamegraph <3 )
  • django-api 实用! 将你的 Django 接口整理在单一代码块中! github.com Shared by @mgrouchy
  • django-linguist 专注管理 Django 模型转换的应用! github.com Shared by @myusuf3
  • pyhipku 将任意 IP 转换为 俳句(hipku) 的包, 细节链接之内. github.com Shared by @mgrouchy
  • Wooey 通过 web 界面自动化运行命令行脚本. github.com Shared by @mgrouchy

文章

DAMA

(大妈私人无责任播报) PyCon Asia-Pacific 2015

是也乎

  • 150316 Zoom.Quiet 用时 42 分钟 完成快译.
  • 150314 Zoom.Quiet 用时 7 分钟 完成格式转抄.