12 2013 档案
摘要:http://ylw6006.blog.51cto.com/470441/888523主数据库负责插入更新等从数据库负责查询等
阅读全文
摘要:基本格式 : * * * * * command 分 时 日 月 周 命令 第1列表示分钟1~59 每分钟用*或者 */1表示 第2列表示小时1~23(0表示0点) 第3列表示日期1~31 第4列表示月份1~12 第5列标识号星期0~6(0表示星期天) 第6列要运行的命令 crontab文件的一些例子: 30 21 * * * /usr/local/etc/rc.d/lighttpd restart 上面的例子表示每晚的21:30重启apache。 45 4 1,10,22 * * /usr/local/etc/rc.d/lighttpd restart 上面的例子表示每月1、10、...
阅读全文
摘要:安装:sudo apt-get install python-tornado sudo apt-get install nginx sudo apt-get install supervisor1. 配置nginx。我安装的nginx的目录为2个配置文件。/etc/nginx/nginx.conf ...
阅读全文
摘要:def SaveAttach():# login the pop3 server ,retrive the new mails ,and download the attachments dstdir =dirname+str(time.ctime(time.time()))+'.zip' print 'starts' pp = poplib.POP3_SSL(mail_host,mail_port) print 'connect successful' pp.set_debuglevel(1) pp.user(mail_user) pp.pas
阅读全文
摘要:def SaveAttachImap():# login the imap server ,retrive the new mails ,and download the attachments. M = imaplib.IMAP4(mail_host,mail_port) #print M M.login(mail_user,mail_pass) M.select('INBOX',False) #result, message = M.select('INBOX',False) typ, data = M.search(None, 'UNSEEN
阅读全文
摘要:def send_mail(to_list, sub, context):#sentmail to the maillist ''' to_list: 发送给谁 sub: 主题 context: 内容 send_mail("xxx@126.com","sub","context") ''' #print 'test begins' mail_host = "smtp.163.com" mail_user = "admin" mail
阅读全文
摘要:参考:http://www.cnblogs.com/dkblog/archive/2011/08/26/2155018.html通过logging.config模块配置日志#logger.conf###############################################[loggers] #有哪些日志记录器,这里有个root,还有2个example01,exampl02keys=root,example01,example02[logger_root]level=DEBUGhandlers=hand01,hand02[logge...
阅读全文
摘要:>>> urllib.unquote('%E4%B8%BD%E6%B1%9F')>>> data'\xe4\xb8\xbd\xe6\xb1\x9f'>>>urllib.quote(data)
阅读全文

浙公网安备 33010602011771号