专用链接解码,链接解码,利用PyQt做界面,将迅
专用链接解码,链接解码,利用PyQt做界面,将迅
利用PyQt做界面,将迅雷快车QQ旋风解码成普通URL
# -*- coding:utf-8 -*-import sysimport base64from PyQt4 import QtCore,QtGuiclass Window(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) self.setWindowTitle(u'专用链接转换') self.setFixedSize(300,200) vbox=QtGui.QVBoxLayout() self.inputbox=QtGui.QTextEdit() vbox.addWidget(self.inputbox) hbox=QtGui.QHBoxLayout() tranbtn=QtGui.QPushButton(u'转换') aboutbtn=QtGui.QPushButton(u'关于') hbox.addWidget(aboutbtn) hbox.addWidget(tranbtn) self.connect(aboutbtn,QtCore.SIGNAL('clicked()'),self.OnAbout) self.connect(tranbtn,QtCore.SIGNAL('clicked()'),self.OnTran) vbox.addLayout(hbox) self.outputbox=QtGui.QTextEdit() vbox.addWidget(self.outputbox) self.setLayout(vbox) def OnAbout(self): QtGui.QMessageBox.about(self,u'关于',u'迅雷、QQ旋风、flashget专用链接转换工具 by ckh') def OnTran(self): url=self.inputbox.toPlainText() if url.isEmpty(): QtGui.QMessageBox.warning(self,'warning',u'没有输入链接') return tranurl=url.split('://') if tranurl[0].toUpper()=='THUNDER': res=base64.decodestring(tranurl[1]) self.outputbox.setText(unicode(res[2:-2],'cp936')) elif tranurl[0].toUpper()=='QQDL': res=base64.decodestring(tranurl[1]) self.outputbox.setText(unicode(res,'cp936')) elif tranurl[0].toUpper()=='FLASHGET': res=base64.decodestring(tranurl[1]) self.outputbox.setText(unicode(res[10:-10],'cp936')) else: QtGui.QMessageBox.warning(self,u'警告',u'输入的地址不是迅雷、QQ旋风或者flashget专用链接')if __name__=='__main__': app=QtGui.QApplication(sys.argv) window=Window() window.show() sys.exit(app.exec_())#该片段来自于http://byrx.net
相关内容
- nginx下使用webpy框架简单小例子,nginxwebpy,nginx下使用w
- python PIL合并半透明的png图片,,如下代码片段使用pyth
- 来个一句话生成随机大乐透,一句话生成,import rando
- python 替换文本,,'''Created o
- python中的日期和时间格式化输出,python日期,下面是格式
- python返回昨天的日期,python返回昨天, #-*-coding:
- 关键字文本过滤器,关键字过滤器,大小写不敏感,可以
- python中id()函数的实用研究实例,python实例,>>>
- django 简单显示数据库的内容,django数据库内容,index.h
- python的循环语句while用法范例,pythonwhile,#!/usr/bin/p
评论关闭