2006年12月30日 星期六 11:44
linecache.py很简单,仅100行代码,但是它出错就仅返回“”,不知哪里出错了。 金庆 http://blog.csdn.net/jq0123 2006-12-30 ======= 2006-12-29 16:54:00 您在来信中写道:======= >确定linecache是否会动态加载一些库? >之前我用pymsql的时候就碰到过这个问题, 要手动在任意的源码中import上这些库才行。 > >On 12/29/06, email在gzemail.cn <email在gzemail.cn> wrote: >> 大家好:昨天发过怎么没人回我的,是不是我说得不明白,大家会的回一下我呀,谢谢 >> 问题是:我在IDLE运行可以正常,也可以得到结果,但是用PY2EXE生成可执行程序后,就是得不出结果,我想是不是linecache的问题?????? >> 源程序: >> # -*- coding: gb2312 -*- >> #c:\Program Files\python\python.exe >> #FileName:get_line.py >> import linecache >> import os >> import sys >> output_file=r'd:\tianyaamy\test.txt' >> result_file=file(r'd:\tianyaamy\result_file.txt','a') >> get=linecache.getline(output_file,3) >> result_file.write(get) >> result_file.close() >> >> >> ---------------------------------------------- >> 欢迎使用广州市市民电子邮局 http://www.gzemail.cn >> >> >> _______________________________________________ >> python-chinese >> Post: send python-chinese在lists.python.cn >> Subscribe: send subscribe to python-chinese-request在lists.python.cn >> Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn >> Detail Info: http://python.cn/mailman/listinfo/python-chinese >_______________________________________________ >python-chinese >Post: send python-chinese在lists.python.cn >Subscribe: send subscribe to python-chinese-request在lists.python.cn >Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn >Detail Info: http://python.cn/mailman/listinfo/python-chinese = = = = = = = = = = = = = = = = = = = =
Zeuux © 2025
京ICP备05028076号