![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python奇技淫巧
solofly752
这个作者很懒,什么都没留下…
展开
-
通过lambda给signal关联的函数传递参数
from PyQt4.QtCore import *from PyQt4.QtGui import *import sysfrom functools import partialapp = QApplication(sys.argv)form = QDialog()layout = QVBoxLayout()label = QLabel("Test")layout.add转载 2012-07-18 10:52:46 · 1925 阅读 · 0 评论 -
SAE笔记django 与 cron
刚开始接触django和SAE,cron的问题查找资料的过程感觉特别费劲,没有谁在专门讲解的。这里总结一下遇到的问题,供大家参考。cron好像是个linux的概念,SAE只是拿来模仿 一下他实现的方式是按照config.yaml配置文件里面指定的路径和时间间隔,请求应用的url,目前是以GET方式请求的比如 如果写成:cron: - url:原创 2014-12-23 10:24:36 · 804 阅读 · 0 评论 -
为pyqt中的listview添加格式字体颜色
import sysfrom PyQt4.QtCore import *from PyQt4.QtGui import *####################################################################def main(): app = QApplication(sys.argv) w = MyWindow()转载 2012-07-18 10:56:50 · 5932 阅读 · 1 评论 -
str_find_all_low_bit.py
class find_all_low(object): def __init__(self, string, wanted): self.forfind = string self.wanted = wanted self.appeareList = [] def findonce(self): re原创 2012-07-12 10:29:32 · 1102 阅读 · 0 评论 -
python 继承实验
class parent(object): def __init__(self): pass def uncle(self): self.aunt() def aunt(self): print 'this is my father\'s aunt'class child(object): def __init_原创 2012-07-18 11:18:44 · 802 阅读 · 0 评论 -
有关python私有变量使用的例子
class A(object): def __init__(self): self.__a = 1 def get_a(self): return self.__a def set_a(self, num): self.__a = numclass a(A): def __init__(self):原创 2012-02-29 10:29:41 · 3994 阅读 · 0 评论 -
引用列表
class test: def contr1(self): #val = struct() #print 'contr1, before, val1',val.val1 #print 'contr1, before, val2',val.val2 #self.follower(val) #print 'cont原创 2012-07-18 11:32:08 · 556 阅读 · 0 评论 -
pyqt signal 发射参数的类型
'''conclusion:QtCore.pyqtSignal is able to send several types of variableincluding int QString QStringList list dict'''from PyQt4 import QtGui, QtCoreimport sysclass prowler(QtGui.QWidget):原创 2012-05-17 15:32:17 · 7134 阅读 · 1 评论 -
python 类方法(classmethod)小实验代码
class c(object): foralll = 8 def __init__(self, i, forall): self.i = i self.test = 0 self.foralll = forall print self.i print self.foralll def d原创 2012-05-21 10:50:19 · 806 阅读 · 0 评论 -
python 编码笔记,字符编码和读取文件
# -*- coding:gb2312CODEC1 = 'gbk'CODEC2 = 'utf-8'CODEC3 = 'ansi'FILE = 'C:/Users/songchen.OF3D/Desktop/chn.txt'#hello_out = u"Hello world沙发呢\n"#bytes_out = hello_out.encode(CODEC)#f = open(FIL原创 2012-05-29 11:47:13 · 586 阅读 · 0 评论 -
python笔记, python 生成注释
>>> class A(): ''' please ''' def __init__(self): pass >>> a = A()>>> def fun(): ''' what is it ''' pass>>> print fun.__doc__ what is it >>> print a.__doc__ please注意应该是原创 2012-06-20 16:59:41 · 390 阅读 · 0 评论 -
enumerate python
line = "createNode place2dTexture -n 'place2dTexture1';createNode file -n 'file2';setAttr '.ftn' -type 'string' 'C:/Users/songchen.OF3D/Pictures/The Lost Watch II NV Screenshot 01.bmp';createNode plac原创 2012-07-18 10:50:24 · 576 阅读 · 0 评论 -
python django sae杂记
前言:这个笔记不是按照严格步骤来记的。主要是一次在sae上部署django框架的小项目,从最开始的django在本地的设置,常用命令,到最后如何部署到sae上,如何同步数据库。网上有关sae python的资料好像不多,这里按照自己遇到的困难依次记录一下,供大家参考。1.测试Django是否安装cmd->运行python->运行 import django->运行django.VERSIO原创 2015-04-09 21:47:55 · 573 阅读 · 0 评论