摘要:
import xml.etree.ElementTree as tree import io xml = ''' 2 2008 141100 5 2011 59900 69 ... 阅读全文
摘要:
def parent(): t = son() print(type(t)) result = t.send(None) # 开始迭代 print(result) result = t.send(20) print(result) result = t.send(None) #引发StopIteration def son(): n... 阅读全文
摘要:
from collections import deque #deque 双端队列 线程安全 可以代替list 更高效 d = deque('abc') #初始化一个队列 for v in d: print(v.upper()) d.append(['1', '2', '3']) #追加 print(d) d.appendleft('1')#左追加 d.extend('123')#... 阅读全文
摘要:
>>> class test(): def __init__(self): pass def __repr__(self): return '1sdf' >>> t = test() >>> t #不用print 直接打印出重构的值,面向程序,在程序中传递 1sdf >>> class test(Exception): def __i... 阅读全文
摘要:
from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.Qt import * import sys, os, time, types class FileInfoTableWidget(QTableWidget): global_row_font =... 阅读全文
摘要:
# 效果图 阅读全文
摘要:
from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import sys class Example(QWidget): _startPos = None _endPos = None _isTracking = False def __init... 阅读全文
摘要:
from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from demo_6 import * import sys class ToolBar(QMainWindow): def __init__(self): super().__init__() ... 阅读全文
摘要:
class PopMenu(QMenu): def __init__(self, parent=None): super().__init__(parent) self.item1 = self.addAction('item1') self.item1.setShortcut(Qt.CTRL | Qt.Key_Q) sel... 阅读全文
摘要:
from bs4 import BeautifulSoup from bs4.element import * data = """ beatifulsoup learning note i`m son1 哈哈 ... 阅读全文