
Python
文章平均质量分 50
Gloveing
http://www.fucku.com/
展开
-
web.py搭建简易网站
import webimport webbrowser urls = ('/' ,'Index' , '/upload', 'Upload')class Upload: def GET(self): return """web.py test username: passwd: Coretest2原创 2012-07-05 13:58:28 · 2472 阅读 · 0 评论 -
selenium:httplib.BadStatusLine异常
网上的解决办法: 一、 from selenium import webdriverprofile = webdriver.FirefoxProfile()profile.set_preference('network.proxy.type', 1)profile.set_preference('network.proxy.http', 'proxy_url')profile.原创 2014-06-04 12:58:50 · 14431 阅读 · 0 评论 -
twisted.web.proxy's known bug
http://stackoverflow.com/questions/3196528/twisted-web-proxy-help http://twistedmatrix.com/trac/ticket/4480原创 2014-06-04 12:57:42 · 536 阅读 · 0 评论 -
Epydoc——Python文档化开发注释规范化工具
Epydoc is a tool for generating API documentation for Python modules, based on their docstrings. For an example of epydoc's output, see the API documentation for epydoc itself (html, pdf). A lightwe原创 2014-06-05 11:10:55 · 5707 阅读 · 0 评论 -
python 获取当前代码行号
import sysprint "here is :",__file__,sys._getframe().f_lineno原创 2014-06-05 11:09:57 · 16778 阅读 · 0 评论 -
SL4A:Library 'libpython2.6.so' not found)CANNOT LINK EXECUTABLE
/storage/sdcard0/sl4a # /data/user/0/com.googlecode.pythonforandroid/files/python/bin/pythonlink_image[1891]: 20076 could not load needed library 'libpython2.6.so' for '/data/user/0/com.googlecode.py原创 2014-06-03 16:46:55 · 4891 阅读 · 0 评论 -
Py2exe打包matplotlib库程序
普通打包出错: RuntimeError: Could not find the matplotlib data files正确打包脚本 :原创 2014-06-03 16:53:00 · 4301 阅读 · 1 评论 -
selenium.common.exceptions.WebDriverException: Message: "Can't load the profile.
使用:Traceback (most recent call last): File "zs.py", line 6, in browser = webdriver.Firefox() File "/usr/lib/python2.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 58, in __i原创 2014-06-03 15:57:52 · 13002 阅读 · 1 评论 -
python cdef
The cdef statement is used to make C level declarations for:Variables、Structs、Unions、Enums、Functions、Extension Types。 http://docs.cython.org/src/reference/language_basics.html#cdef原创 2014-06-03 16:44:53 · 1594 阅读 · 0 评论 -
python 字符串与16进制互转
>>> binascii.b2a_hex(u"你好啊".encode("utf8"))'e4bda0e5a5bde5958a'>>>>>>>>> binascii.b2a_hex(u"你好啊".encode("gbk"))'c4e3bac3b0a1'>>> binascii.a2b_hex("e4bda0e5a5bde5958a")'\xe4\xbd\xa0\xe5\xa5\xbd\原创 2014-06-03 16:47:46 · 73784 阅读 · 2 评论 -
解决HTTP 302
原创 2014-07-08 15:56:16 · 2053 阅读 · 0 评论 -
COM-IE-(1)
# -*- coding:UTF-8 -*- from time import sleepimport win32com.clientfrom win32com.client import DispatchExclass COM_IE: def __init__(self,url=None): self.url = url self.Visible = 1 self.ie原创 2014-10-28 16:59:48 · 1068 阅读 · 0 评论 -
pyquery示例-获取FreeBuf新闻标题
from pyquery import PyQuery as pq d = pq(url="http://www.freebuf.com/")alist = d(".newspic01") print u"获取freebuf最新新闻的标题"for node in range(len(alist)): print "%d.%s" %( node+1 , alist.eq(node原创 2014-02-11 20:05:47 · 1332 阅读 · 0 评论 -
COM-IE-(2)
COM操作IE原创 2014-10-29 10:48:43 · 1556 阅读 · 0 评论 -
python 发送飞信-短信接口
#========================================================# 2013/09/2 # http://blog.youkuaiyun.com/agoago_2009 #========================================================# -*- co原创 2013-09-02 15:52:22 · 3629 阅读 · 1 评论 -
web qq 获取好友列表hash算法
web qq 获取好友列表hash算法在使用web qq的接口进行好友列表获取的时候,需要post一个参数:hash在对其js文件进行分析之后,发现计算hash的函数位于:http://0.web.qstatic.com/webqqpic/pubapps/0/50/eqq.all.js这个文件中: P = function(b, i) { for (var a =原创 2013-07-26 11:20:09 · 5037 阅读 · 1 评论 -
py2exe ImportError: No module named sip
简单解决方法: c:\Python26\python.exe setup.py py2exe --includes sip 使用pyqt完成窗体界面很方便,但是打包成exe之后会有问题,在网上找到解决办法如下:Another Solution to the same problem:from distutils.core import setupimpo转载 2012-02-25 00:29:06 · 12256 阅读 · 1 评论 -
利用cx_Freeze将py文件打包成exe文件
在python中比较常用的python转exe方法有三种,分别是cx_freeze,py2exe,PyInstaller。py2exe恐怕是三者里面知名度最高的一个,但是同时相对来说它的打包质量恐怕也是最差的一个。pyinstaller打包很好,但是操作工序较为复杂。so个人还是推荐cx_freeze。 但是py2exe不支持我的 python-3.2.2,没办法,只有用 cx_free原创 2012-02-18 14:02:29 · 3280 阅读 · 0 评论 -
pickle模块
import picklef = open('test.ini','w')params = { 'access_token':'181770' , 'token_expires_in' : 2594366 , 'token_created_timestamp': 1341832737 , 'AAA':1111111111 }pickle.dump( param原创 2012-07-09 22:07:59 · 1096 阅读 · 0 评论 -
python 操作IE
#========================================================# python 操作IE登录人人网 # 2012/07/29 20:05:11 #============原创 2012-07-29 21:54:39 · 2967 阅读 · 1 评论 -
python 使用COM执行JS
import win32com.client, pythoncomfrom time import sleep ie=win32com.client.Dispatch('internetexplorer.application')ie.Visible=1ie.Navigate('http://www.cpplab.com/Articles/JSCalls/TestPage/转载 2012-07-29 22:11:52 · 2361 阅读 · 0 评论 -
Submitting values and clicking buttons in IE
# Use the makepy utility for the "Microsoft Internet Controls (1.1)"# object library to get early binding.from win32com.client import Dispatchfrom time import sleep ie = Dispatch("InternetEx转载 2012-07-29 22:16:35 · 501 阅读 · 0 评论 -
Get all URLs from a webpage
import win32com.client, timeie = win32com.client.Dispatch("InternetExplorer.Application") ie.Visible = 1 ie.Navigate('http://www.goermezer.de') time.sleep(3) #wait 3 sec. print 'You are surf转载 2012-07-29 22:15:20 · 563 阅读 · 0 评论 -
COM操作excel
#========================================================# 2012/07/31 23:18:22 #========================================================from win32com.client import原创 2012-07-31 23:37:33 · 864 阅读 · 0 评论 -
C语言调用python代码
直接上代码://#========================================================//# author:ago //# 2012/08/24 19:26:57 //#===========原创 2012-09-21 11:57:37 · 3479 阅读 · 0 评论 -
python简明教程
原创 2012-10-23 14:30:27 · 930 阅读 · 0 评论 -
python中的super
python super一、问题的发现与提出 在Python类的方法(method)中,要调用父类的某个方法,在Python 2.2以前,通常的写法如代码段1: 代码段1: class A: def __init__(self): print "enter A" print "leave A" class B(A): def _原创 2012-11-19 09:46:19 · 1100 阅读 · 0 评论 -
正则表达式
1。^\d+$ //匹配非负整数(正整数 + 0) 2。^[0-9]*[1-9][0-9]*$ //匹配正整数 3。^((-\d+)|(0+))$ //匹配非正整数(负整数 + 0) 4。^-[0-9]*[1-9][0-9]*$ //匹配负整数 5。^-?\d+$ //匹配整数 6。^\d+(\.\d+)?$ //匹配非负浮点数(正浮点数 + 0) 7。^(原创 2012-11-19 10:46:07 · 496 阅读 · 0 评论 -
PamIE 和COM调用IE出错: TypeError: getElementById() takes exactly 1 argument (2 given)
import win32com.client,pythoncomimport timeie = win32com.client.DispatchEx('InternetExplorer.Application')ie.Visible = 1ie.Navigate('http://ieeexplore.ieee.org/xpl/periodicals.jsp')time.sleep(5)i原创 2012-12-06 14:39:31 · 4657 阅读 · 0 评论 -
webqq登录协议分析
webqq登录协议分析通过webqq接口,可以实现发送、接收qq消息。1。首先调用:http://ptlogin2.qq.com/check?appid=1002101&uin=qq号码&js_ver=10034&js_type=0&login_sig=g3W6wI0s*Da9mp6xHYdgm7iP-D7LBMId01umPiT0WTQQShsmCdWxgBD8vtI6Gltq&u1原创 2013-07-26 11:08:32 · 7307 阅读 · 1 评论 -
如何定制自己的华为ROM
1. 找到合适的原厂刷机包你需要的工具:“Huawei Firmware Finder”搜索“com.teammt.gmanrainy.huaweifirmwarefinder”并下载该apk即可下载到原厂的固件。2. 解析update.app解析的工具:https://github.com/qiaofei32/huawei_rom网上有几个现成可用的程序/脚本,如:HuaweiUpdateExt...原创 2018-04-27 17:06:13 · 3627 阅读 · 0 评论