摘要: # -*- coding: cp936 -*- import urllib2,urllib,sys """ 使用GET在百度搜索引擎上查询 在百度的搜索条中随便输入一些内容,会有w和cl两项构成GET串 此例演示如何生成GET串,并进行请求. """ url = "http://www.baidu.com/s" search = [('w','python'),('cl','3')] getSt... 阅读全文
posted @ 2009-04-16 22:47 dkcndk 阅读(10365) 评论(0) 推荐(0) 编辑
摘要: 其实很简单,用python -m py_compile file.pypython -m py_compile /root/src/{file1,file2}.py编译成pyc文件。也可以写份脚本来做这事:Code:import py_compile py_compile.compile('path') //path是包括.py文件名的路径用python -O -m py_compile file.py编译成pyo文件。1.其中的 -m 相当于脚本中的import,这里的-m py_compile 相当于上面的 import py_compile 2.-O 如果改成 -OO 则 阅读全文
posted @ 2009-04-16 19:13 dkcndk 阅读(144272) 评论(3) 推荐(9) 编辑
摘要: Microsoft Windows XP [版本 5.1.2600] (C) 版权所有 1985-2001 Microsoft Corp. C:\Documents and Settings\EVAN>cd c:\php5 C:\php5>php.exe cli.php uuu PHP Warning: file_get_contents(uuu): failed to open strea... 阅读全文
posted @ 2009-04-16 00:53 dkcndk 阅读(1482) 评论(0) 推荐(0) 编辑