
Python
lslxdx
个人主页: http://www.lslxdx.com
Github: https://github.com/lslxdx
展开
-
Python中, 使用setup.py和console_scripts参数创建安装包和shell命令
项目目录结构setup_test├── my_project│ ├── __init__.py│ └── __main__.py└── setup.py文件内容 - __setup__.pyfrom setuptools import setupsetup(name='my_project', version='0.1.0', packages=['my_pr原创 2017-06-12 18:15:21 · 7614 阅读 · 0 评论 -
使用metaclass验证子类
实验代码# coding: utf-8# Python2中定义Metaclass, 该Metaclass要继承自type, 实现__new__方法class MetaCls(type): def __new__(meta, name, bases, class_dict): print (meta, name, bases, class_dict) if c原创 2017-10-22 14:22:19 · 676 阅读 · 0 评论 -
实用Unicode
翻译: https://nedbatchelder.com/text/unipain.html这是我在PyCon 2012做的一次分享。你看在这个页面看到演示稿和描述文字,也可以用浏览器打开分享稿,也可以直接看这个分享视频。点击演示稿会调到全屏模式。 因为里面使用了Symbola字体,使用你需要在哪些特殊符号出现之前就先下载这个字体。大家好,我是Ned Batchelder。我写Python已经1翻译 2017-11-08 20:50:37 · 1133 阅读 · 0 评论