随笔 - 13, 文章 - 0, 评论 - 7, 阅读 - 14896

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

09 2012 档案

摘要:PS: util文件夹中要自行创建__init__.py文件,内容可以为空#\util\MailSenderHelp.pyimport smtplibfrom email.mime.text import MIMETextimport base64class Mailsender(): def __init__(self): print "I am sending the mails..." def setSmtpServer(self, smtpServer): self.smtpserver = smtpServer ... 阅读全文

posted @ 2012-09-29 10:16 moose 阅读(247) 评论(0) 推荐(0) 编辑

摘要:代码更新: 2013/1/11解决本地文件夹或文件名中有空格的问题代码更新: 2012/9/25去除ping小黑窗优化代码结构代码已更新 2012/9/24下载全部文件1. 程序只会下载含有关键字(forme)的文件2.程序只会执行vbs或者bat类型的文件(如果需要可自行添加更多的文件支持)3.如果需要更新当前程序,新文件(ftp上的文件)需要包含关键字(syncftp)4.如果本地有同名文件,程序不会进行下载5.如果本地程序已执行过,则不会再次执行6.程序运行时会生成两个文件,一个是log文件,一个是配置文件7. 如果需要定时执行,可以写为计划任务 代码如下:'********** 阅读全文

posted @ 2012-09-23 09:56 moose 阅读(3027) 评论(0) 推荐(0) 编辑

摘要:buffer = 8192 来自网络,但不知道是怎么实践出来的。from hashlib import md5import timeimport os def calMD5(str): m = md5() m.update(str) return m.hexdigest()def calMD5ForFile(file): statinfo = os.stat(file) if int(statinfo.st_size)/(1024*1024) >= 1000 : print "File size > 1000, move to big... 阅读全文

posted @ 2012-09-04 13:40 moose 阅读(2668) 评论(0) 推荐(0) 编辑

摘要:参考地址:http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/how-to-convert-ip-addresses-between-bigi程序代码:import sysdef ipToBigint(ipaddr): ipStrs = ipaddr.split(".") return str(int(ipStrs[3]) + int(ipStrs[2])*256 + int(ipStrs[1])*256*256 + int(ipStrs[0])*256*256*256) def bigintToIp(int 阅读全文

posted @ 2012-09-03 15:08 moose 阅读(750) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示