10 2012 档案
摘要:####################################################################from ftplib import FTPimport socketsocket.setdefaulttimeout(5) #设置了全局默认超时时间def ftp_open(host,user,passwd,port=21): #打开FTP try: ftp = FTP(host) ftp.connect(host,port) #连接 服务器名 端口号 ftp.login(user,passwd) ...
阅读全文
摘要:#!user/bin/env python#-*- coding:utf-8 -*-import reall=re.compile('(\d+\.\d+[eE][-+]?\d+|\d+\.\d+|[1-9]\d*|0[0-7]+|0x[0-9a-fA-F]+|[a-zA-Z_]\w*|>>|<<|::|->|\.|\+=|\-=|\*=|/=|%=|>=|<=|==|!=|&&|\|\||\+|\-|\*|/|=|>|<|!|^|%|~|\?|:|,|;|\(|\)|\[|\]|\{|\}|\'|\"
阅读全文
摘要:The Zen of Python-----------------Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases aren't special enough to break the rules.Altho
阅读全文