码迷,mamicode.com
首页 >  
搜索关键字:python module    ( 144473个结果)
python 的 class
虽然python OOP 是可选的,但是尽可能使用OOP, 可以让你的代码更精简,容易理解。python 中大多数OOP故事, 都可简化为这个表达式:object.attribute类的建立使用class 语句类中的赋值语句对应属性类中的函数对应方法每次从类中产生实例时, python 会自动调用_...
分类:编程语言   时间:2014-07-29 11:36:36    阅读次数:249
python学习第二天:数字与字符串转换及逻辑值
1.数字与字符串的转化 #1.数字转字符,使用格式化字符串: *1.demo = ‘%d’ % source *2.%d整型;%f 浮点型 ;%e科学计数 *3.int('source') #转化为int型 #2.字符串转化为数字 *1.导入string :import str...
分类:编程语言   时间:2014-07-29 11:34:16    阅读次数:234
rhythmbox插件开发笔记2:背景知识学习 D-Bus&VFS&Gio& Python GTK+ 3
这次主要简单介绍下相关的背景知识D-Bus&VFS&Gio& Python GTK+ 3D-BusD-Bus是开源的进程通信(IPC)系统,它允许多个进程进行实时通信。D-Bus提供以下功能:完成在同一个桌面会话下的多个桌面应用程序间的通信,将整个桌面会话联合成一个整体,并为进程分配生存期完成桌面会...
分类:编程语言   时间:2014-07-29 11:32:26    阅读次数:288
python ConfigParser例子01
importConfigParserdefwriteConfig(filename):config=ConfigParser.ConfigParser()#setdbsection_name='db'config.add_section(section_name)config.set(section...
分类:编程语言   时间:2014-07-29 11:27:16    阅读次数:217
python ConfigParser例子02
#coding:utf-8importConfigParserclassConf():def__init__(self,name):self.name=nameself.cp=ConfigParser.ConfigParser()self.cp.read(name)defgetSections(se...
分类:编程语言   时间:2014-07-29 11:25:16    阅读次数:290
PYQT基础知识信号+例子
QtCore.QObject.connect(A,SIGNAL(obj),B)A.SIGNAL.CONNECT(B)QtCore.QObject.connect(a.obj,SIGNAL(obj),B,SLOT(obj2))1.一个信号可以与另一个信号相连connect(Object1,SIGNAL...
分类:其他好文   时间:2014-07-29 11:18:36    阅读次数:700
一个类似植物大战僵尸的python源码
# 1 - Import libraryimport pygamefrom pygame.locals import *import mathimport random# 2 - Initialize the gamepygame.init()width, height = 640, 480scre...
分类:编程语言   时间:2014-07-29 11:06:46    阅读次数:643
Hangman游戏源代码 --- python实现
#hangman.pyfrom PythonCard import model,dialogimport randomdef find_letters(letter,a_string): locations = [] start = 0 while a_string.find(le...
分类:编程语言   时间:2014-07-29 11:02:46    阅读次数:562
一个python游戏源码
#finalPyPong.pyimport pygame,sysclass MyBallClass(pygame.sprite.Sprite): def __init__(self,image_file,speed,location=[0,0]): pygame.sprite.S...
分类:编程语言   时间:2014-07-29 11:02:36    阅读次数:404
Python:SQLMap源码精读—start函数
源代码 1 def start(): 2 """ 3 This function calls a function that performs checks on both URL 4 stability and all GET, POST, Cookie and U...
分类:数据库   时间:2014-07-29 10:37:46    阅读次数:422
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!