随笔分类 -  python

摘要:1. web框架介绍: 阅读全文
posted @ 2017-12-08 12:25 HexOxZhw 阅读(157) 评论(0) 推荐(0)
摘要:#大部分来自于http://www.runoob.com/django 1.创建第一个项目: 目录说明: HelloWorld: 项目的容器。 manage.py: 一个实用的命令行工具,可让你以各种方式与该 Django 项目进行交互。 HelloWorld/__init__.py: 一个空文件, 阅读全文
posted @ 2017-12-04 11:18 HexOxZhw 阅读(458) 评论(0) 推荐(0)
摘要:1.析构问题: python import gc #del之后 调用gc.collect() #当有数据写入硬盘的时候,一定要显式清空变量内的数据 templist = templist[:] del templist gc.collect() 2.2b 语法 class UpperAttrMeta 阅读全文
posted @ 2017-11-10 15:09 HexOxZhw 阅读(294) 评论(0) 推荐(0)
摘要:1.临时变量 实例化的窗口,show之后会自动被释放。 tipWidget = QtGui.QWidget() tipWidget.show() tipWidget会闪一下就被释放了。 应该用成员变量: self.tipWidget = QtGui.QWidget() self.tipWidget. 阅读全文
posted @ 2017-06-12 11:51 HexOxZhw 阅读(268) 评论(0) 推荐(0)
摘要:pyqt 窗口嵌套多次之后,signal 会出现信号丢失的问题。 也就是说 signal.emit 失效 阅读全文
posted @ 2017-06-12 11:34 HexOxZhw 阅读(2042) 评论(0) 推荐(0)
摘要:super(MyQObject, self).__init__() #如果写了__init__()函数,这一行一定要有,否则会出现 #TypeError: pyqtSignal must be bound to a QObject, not 'MyQObject' 阅读全文
posted @ 2017-06-09 12:55 HexOxZhw 阅读(258) 评论(0) 推荐(0)
摘要:__str()是一个特殊的方法,可以把类变成实例。 直接用tmp1的时候,是不会调用__str()__的 __repr()__ 是将一个对象转化为字符串显示,仅仅是显示。 object.__repr__(self): called by the repr() built-in function an 阅读全文
posted @ 2017-05-27 17:00 HexOxZhw 阅读(262) 评论(0) 推荐(0)
摘要:1 # coding=utf-8 2 ''' 3 Created by Alpha on 2017-05-25. 4 Copyright (c) 2018 Alpha.All rights reserved. 5 ''' 6 try: 7 from PyQt4 import QtGui, QtCore 8 from PyQt4.QtCore im... 阅读全文
posted @ 2017-05-26 02:07 HexOxZhw 阅读(214) 评论(0) 推荐(0)
摘要:# encoding:utf-8import jsondata={"user":"张三","sex":"男"}f = open("/home/alpha/Desktop/test1","w")f.write(json.dumps(data,ensure_ascii=False,encoding='u 阅读全文
posted @ 2017-05-17 15:03 HexOxZhw 阅读(399) 评论(0) 推荐(0)