python 函数__dict__属性

究竟函数的__dict__是干什么用的呢? 其实它提供给函数增加属性的功能 比如还是那个简单的例子: In [4]: def add(x,y): ...: return x+y ...: 显是一下这个函数的属性: In [13]: print dir...

Tornado web开发之简单文件上传

1、介绍 我们知道,在web开发过程中,文件上传是经常用到的功能,比如上传附件,上传照片等 下面我们来介绍一下利用tornado 来实现文件上传功能 2.代码 由于实现文件上传的表单很简单,只需要...

Python标准库学习之functools

1.partial类 官方的help文档如是描述partial partial(func, *args, **keywords) -- new function with partial application of the given arguments and keywords. 即产生一个带有给定的参数...

使用pyinstaller打包python代码

安装: 从http://www.pyinstaller.org/下载最新的pyinstaller软件包, 当前的最新版本是pyinstaller-2.0 pyinstaller-2.0.tar.bz2 tar jxvf pyinstaller-2.0.tar.bz2 python 2.0是一个可以免...

python daemon 守护进程对信号的处理

#!/usr/bin/python # import sys import os import time import atexit import signal class PyDaemon(object):     def __init__(self,pidfile,stdin='/dev/null',stdout='/dev/null',s...

2013/04/10 16:19
1.1K

没有更多内容

加载失败,请刷新页面