摘要: 最近学习Python核心编程(第二版)第52页代码中有部分错误,在纠错的同时也进行了一些优化完善处理,初学Python不足之处,请大家多多指教。相关代码如下: 1 [root@CentOS-6 ~]# cat maketextfile.py 2 3 #!/usr/bin/env python 4 #coding:utf-8 5 6 import os 7 import time 8 import sys 9 fname = 'write.log'10 ls = os.linesep11 while True:12 if os.path.exists(fname):13 ... 阅读全文
posted @ 2013-06-16 00:57 study-notes 阅读(190) 评论(0) 推荐(0) 编辑