上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 终极解决方法来啦!看代码感受: 5s以后会把read()方法给掐了 另见 http://stackoverflow.com/questions/2281850/timeout-function-if-it-takes-too-long-to-finish 阅读全文
posted @ 2016-07-11 09:52 龟窝 阅读(358) 评论(0) 推荐(0) 编辑
摘要: http://blog.alejandronolla.com/2013/05/15/detecting-text-language-with-python-and-nltk/ >>> from nltk import wordpunct_tokenize >>> wordpunct_tokenize 阅读全文
posted @ 2016-06-19 12:27 龟窝 阅读(255) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/mywolrd/p/4756005.html 将Python脚本打包成可执行文件 Python是一个脚本语言,被解释器解释执行。它的发布方式: .py文件:对于开源项目或者源码没那么重要的,直接提供源码,需要使用者自行安装Python并且安装依赖的各种库 阅读全文
posted @ 2016-04-08 21:57 龟窝 阅读(28376) 评论(0) 推荐(1) 编辑
摘要: http://www.cyberciti.biz/faq/python-run-external-command-and-get-output/ http://stackoverflow.com/questions/1124884/interact-with-a-windows-console-ap 阅读全文
posted @ 2016-04-07 01:30 龟窝 阅读(375) 评论(0) 推荐(0) 编辑
摘要: res00是一张rgb图 [x for sub1 in res00 for sub2 in sub1 for x in sub2] 列出所有像素值 阅读全文
posted @ 2016-03-27 21:04 龟窝 阅读(776) 评论(0) 推荐(0) 编辑
摘要: >>> import urllib >>> a = "PythonTab中文网" >>> a 'PythonTab\xe4\xb8\xad\xe6\x96\x87\xe7\xbd\x91' >>> urllib.quote(a) 'PythonTab%E4%B8%AD%E6%96%87%E7%BD% 阅读全文
posted @ 2016-03-27 02:33 龟窝 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 参考 http://www.cnblogs.com/pzxbc/archive/2012/03/18/2404715.html python的pickle模块实现了基本的数据序列和反序列化。通过pickle模块的序列化操作我们能够将程序中运行的对象信息保存到文件中去,永久存储;通过pickle模块的 阅读全文
posted @ 2016-03-24 02:01 龟窝 阅读(172) 评论(0) 推荐(0) 编辑
摘要: sys.stdout.write('\r'+str) sys.stdout.flush() time.sleep(1) 阅读全文
posted @ 2016-03-23 18:11 龟窝 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: Python在往文件里写东西的时候,如果ascii码报错 参考 http://stackoverflow.com/questions/19833440/unicodeencodeerror-ascii-codec-cant-encode-character-u-xe9-in-position-7 Y 阅读全文
posted @ 2016-03-23 17:41 龟窝 阅读(1216) 评论(0) 推荐(0) 编辑
摘要: json.loads(s) returns error message like this: According to http://docs.python.org/2/library/json.html "If strict is False (True is the default), then 阅读全文
posted @ 2016-03-20 22:05 龟窝 阅读(302) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页