03 2016 档案

摘要:字符串在Python内部的表示是unicode 编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str 阅读全文
posted @ 2016-03-30 02:41 weiokx 阅读(431) 评论(0) 推荐(0) 编辑
摘要:python中对文件、文件夹(文件操作函数)的操作需要涉及到os模块和shutil模块。 得到当前工作目录,即当前Python脚本工作的目录路径: os.getcwd() 返回指定目录下的所有文件和目录名:os.listdir(path) 函数用来删除一个文件:os.remove(file) 删除多 阅读全文
posted @ 2016-03-30 00:28 weiokx 阅读(391) 评论(0) 推荐(0) 编辑
摘要:$ crontab -e 例如:每天两点钟执行 0 2 */1 * * /usr/bin/python /www/tbktsh/sendms.py &> /dev/null 01 * * * * root run-parts /etc/cron.hourly # 每小时执行/etc/cron.hou 阅读全文
posted @ 2016-03-02 09:43 weiokx 阅读(855) 评论(0) 推荐(0) 编辑