码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
进度条
importsysfromPyQt4importQtGui,QtCoreclassExample(QtGui.QWidget):def__init__(self):super(Example,self).__init__()self.initUI()definitUI(self):self.pbar...
分类:其他好文   时间:2015-01-04 18:37:58    阅读次数:138
pyqt时间
#-*-coding:utf-8-*-__author__='Administrator'fromPyQt4importQtCore,QtGuiclassHelp(QtGui.QMainWindow):def__init__(self):super(Help,self).__init__()#QTi...
分类:其他好文   时间:2015-01-04 14:59:37    阅读次数:208
kv文件读写 in Python & C++
文件格式均为kv对,即keylength, key, valuelen, value. 如何对其进行读写操作,本文列出demo code。感谢涛哥贡献部分代码,这里分享,方便大家使用。Python:def readimg(): fr = open('IMG_2963.JPG','r') keylen = struct.unpack('i',fr.read(4))[0] key = fr.re...
分类:编程语言   时间:2015-01-04 12:12:28    阅读次数:207
oracle 数据插入
语法结构:INSERT INTO 表名(列名1,列名2……) VALUES (值1,值2……) 代码演示: SQL> INSERT INTO INFOS VALUES (  ①   2  's100102', '林冲', '男', 22, 2,   3  TO_DATE('2009-8-9 06:30:10',' YYYY-MM-DD HH24:MI:SS '),  ②   4 ,def...
分类:数据库   时间:2015-01-04 09:58:09    阅读次数:172
gcc源代码分析,debug_tree()函数,又一利器啊
gcc源代码分析,debug_rtx()函数,利器啊 print-tree.c #include "config.h" #include "tree.h" #include /* Names of tree components.    Used for printing out the tree and error messages.  */ #def...
分类:其他好文   时间:2015-01-03 22:29:52    阅读次数:174
leetcode 【 Insertion Sort List 】 python 实现
题目:Sort a linked list using insertion sort.代码:oj测试通过Runtime:860 ms 1 # Definition for singly-linked list. 2 # class ListNode: 3 # def __init__(sel...
分类:编程语言   时间:2015-01-03 21:03:14    阅读次数:208
python md5 加密模块
今天有同学找到我说,能不能写一个简单的python md5加密模块,作为服务器端程序的响应函数。信息安全之类的问题了。md5采用单向加密机制。 直接上代码: (k1, k2 是系统自动生成的随机整数,user_name是用户名) def encrypt (a="user_name" , k1=1 , k2=1): #get system time b ...
分类:编程语言   时间:2015-01-03 17:24:32    阅读次数:451
《大话设计模式》ruby版代码:代理模式
需求:小明让小李替他追小丽(送洋娃娃,送花,送巧克力)没有代理的代码:# -*- encoding: utf-8 -*-#追求者类class Pursuit attr_accessor :mm def initialize(mm) @mm = mm end ...
分类:其他好文   时间:2015-01-02 19:50:40    阅读次数:242
python之web路径扫描工具
# coding: UTF-8import sys, os, time, httplibimport relist_http=[] #http数组def open_httptxt(): #打开TXT文本写入数组 try: passlist = [] list_passlist=[] xxx = fi...
分类:编程语言   时间:2015-01-02 18:43:27    阅读次数:278
Python读书笔记1
最近在学习《编写高质量代码-改善python程序的91个建议》,记录下读书笔记使用版本:Python 3.4.0系统:Windows71.字符串格式化: 1 def show(name,age,email): 2 #普通方法 3 print('your name is: %s \ny...
分类:编程语言   时间:2015-01-02 15:48:49    阅读次数:273
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!