请告诉我示例,如何使用顺序访问创建 - PyQt4.QtCore.QIODevice
。这必须是像这样的QIODevice:
printing - isinstance(data, QIODevice) : True
printing - data.isSequential(): True
printing - data.isTextModeEnabled(): False
printing - data.dumpObjectTree(): None
printing - data.__weakref__: None
printing - data.__class__: <class 'PyQt4.QtCore.QIODevice'>
printing - data.__dict__: {}
printing - data.__doc__': QIODevice()
QIODevice(QObject)
printing - data.__format__': <built-in method __format__ of QIODevice object at 0x02C2EDA0>
printing - data.'__reduce__': <built-in method __reduce__ of QIODevice object at 0x02C2EDA0>
printing - data.'__reduce_ex__': <built-in method __reduce_ex__ of QIODevice object at 0x02C2EDA0>
print dir(data)
打印 - [&#39;追加&#39;,&#39; NotOpen&#39;,&#39; OpenMode&#39;,&#39; OpenModeFlag&#39;,&#39; ReadOnly&#39;,&# 39; ReadWrite&#39;,&#39; Text&#39;,&#39;截断&#39;,&#39; Unbuffered&#39;,&#39; WriteOnly&#39;,&#39; 课程&#39;,&#39; delattr &#39;,&#39; dict &#39;,&#39; doc &#39;,&#39; 格式&#39;,&#39; getattr &#39;,&#39; < strong> getattribute &#39;,&#39; 哈希&#39;,&#39; init &#39;,&#39; 模块&#39;,&#39; 新&#39;,&#39; 降低&#39;,&#39;&#39; ; reduce_ex &#39;,&#39; repr &#39;,&#39; setattr &#39;,&# 39; sizeof &#39;,&#39; str &#39;,&#39; 子类隐藏&#39;,& #39; weakref &#39;,&#39; aboutToClose&#39;,&#39; atEnd&#39;,&#39; blockSignals&#39;,#39; bytesAvailable&#39 ;,&#39; bytesToWrite&#39;,&#39; b ytesWritten&#39;,&#39; canReadLine&#39;,childEvent&#39;,&#39; children&#39;,&#39; close&#39;,&#39; connect&#39;, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #39;,&#39; dumpObjectInfo&#39;,&#39; dumpObjectTree&#39;,&#39; dynamicPropertyNames&#39;,&#39; emit&#39;,&#39; errorString&#39;,& #39; event&#39;,&#39; eventFilter&#39;,&#39; findChild&#39;,&#39; findChildren&#39;,&#39; getChar&#39;,&#39; inherits&# 39;,&#39; installEventFilter&#39;,&#39; isOpen&#39;,&#39; isReadable&#39;,&#39; isSequential&#39;,&#39; isTextModeEnabled&#39;,&# 39; isWidgetType&#39;,&#39; isWritable&#39;,&#39; killTimer&#39;,&#39; metaObject&#39;,&#39; moveToThread&#39;,&#39; objectName&#39 ;,&#39; open&#39;,&#39; openMode&#39;,&#39; parent&#39;,&#39; peek&#39;,&#39; pos&#39;,&#39 ; property&#39;,&#39; putChar&#39;,&#39; pyqtConfigure&#39;,&#39; read&#39;,&#39; readAll&#39;,&#39; readChannelFinished&#39; ,&#39; readData&#39;, &#39; readLine&#39;,&#39; readLineData&#39;,&#39; readyRead&#39;,&#39; receiver&#39;,&#39; removeEventFilter&#39;,&#39; reset& #39;,&#39;搜索&#39;,&#39;发件人&#39;,&#39; senderSignalIndex&#39;,&#39; setErrorString&#39;,&#39; setObjectName&#39;,& #39; setOpenMode&#39;,&#39; setParent&#39;,&#39; setProperty&#39;,&#39; setTextModeEnabled&#39;,&#39; signalsBlocked&#39;,&#39; size&# 39;,&#39; startTimer&#39;,&#39; staticMetaObject&#39;,&#39; thread&#39;,&#39; timerEvent&#39;,&#39; tr&#39;,&# 39; trUtf8&#39;,&#39; ungetChar&#39;,&#39; waitForBytesWritten&#39;,&#39; waitForReadyRead&#39;,&#39; write&#39;,&#39; writeData&#39 ]
Print all properties:
obj.Append = 4
obj.NotOpen = 0
obj.OpenMode = <class 'PyQt4.QtCore.OpenMode'>
obj.OpenModeFlag = <class 'PyQt4.QtCore.OpenModeFlag'>
obj.ReadOnly = 1
obj.ReadWrite = 3
obj.Text = 16
obj.Truncate = 8
obj.Unbuffered = 32
obj.WriteOnly = 2
obj.__class__ = <class 'PyQt4.QtCore.QIODevice'>
obj.__delattr__ = <method-wrapper '__delattr__' of QIODevice object at 0x02C2EDA0>
obj.__dict__ = {}
obj.__doc__ = QIODevice()
QIODevice(QObject)
obj.__format__ = <built-in method __format__ of QIODevice object at 0x02C2EDA0>
obj.__getattr__ = <built-in method __getattr__ of QIODevice object at 0x02C2EDA0>
obj.__getattribute__ = <method-wrapper '__getattribute__' of QIODevice object at 0x02C2EDA0>
obj.__hash__ = <method-wrapper '__hash__' of QIODevice object at 0x02C2EDA0>
obj.__init__ = <method-wrapper '__init__' of QIODevice object at 0x02C2EDA0>
obj.__module__ = PyQt4.QtCore
obj.__new__ = <built-in method __new__ of sip.wrappertype object at 0x5F4232B0>
obj.__reduce__ = <built-in method __reduce__ of QIODevice object at 0x02C2EDA0>
obj.__reduce_ex__ = <built-in method __reduce_ex__ of QIODevice object at 0x02C2EDA0>
obj.__repr__ = <method-wrapper '__repr__' of QIODevice object at 0x02C2EDA0>
obj.__setattr__ = <method-wrapper '__setattr__' of QIODevice object at 0x02C2EDA0>
obj.__sizeof__ = <built-in method __sizeof__ of QIODevice object at 0x02C2EDA0>
obj.__str__ = <method-wrapper '__str__' of QIODevice object at 0x02C2EDA0>
obj.__subclasshook__ = <built-in method __subclasshook__ of PyQt4.QtCore.pyqtWrapperType object at 0x02386968>
obj.__weakref__ = None
obj.aboutToClose = <bound signal aboutToClose of QIODevice object at 0x02C2EDA0>
obj.atEnd = <built-in method atEnd of QIODevice object at 0x02C2EDA0>
obj.blockSignals = <built-in method blockSignals of QIODevice object at 0x02C2EDA0>
obj.bytesAvailable = <built-in method bytesAvailable of QIODevice object at 0x02C2EDA0>
obj.bytesToWrite = <built-in method bytesToWrite of QIODevice object at 0x02C2EDA0>
obj.bytesWritten = <bound signal bytesWritten of QIODevice object at 0x02C2EDA0>
obj.canReadLine = <built-in method canReadLine of QIODevice object at 0x02C2EDA0>
obj.childEvent = <built-in method childEvent of QIODevice object at 0x02C2EDA0>
obj.children = <built-in method children of QIODevice object at 0x02C2EDA0>
obj.close = <built-in method close of QIODevice object at 0x02C2EDA0>
obj.connect = <built-in method connect of QIODevice object at 0x02C2EDA0>
obj.connectNotify = <built-in method connectNotify of QIODevice object at 0x02C2EDA0>
obj.customEvent = <built-in method customEvent of QIODevice object at 0x02C2EDA0>
obj.deleteLater = <built-in method deleteLater of QIODevice object at 0x02C2EDA0>
obj.destroyed = <bound signal destroyed of QIODevice object at 0x02C2EDA0>
obj.disconnect = <built-in method disconnect of QIODevice object at 0x02C2EDA0>
obj.disconnectNotify = <built-in method disconnectNotify of QIODevice object at 0x02C2EDA0>
obj.dumpObjectInfo = <built-in method dumpObjectInfo of QIODevice object at 0x02C2EDA0>
obj.dumpObjectTree = <built-in method dumpObjectTree of QIODevice object at 0x02C2EDA0>
obj.dynamicPropertyNames = <built-in method dynamicPropertyNames of QIODevice object at 0x02C2EDA0>
obj.emit = <built-in method emit of QIODevice object at 0x02C2EDA0>
obj.errorString = <built-in method errorString of QIODevice object at 0x02C2EDA0>
obj.event = <built-in method event of QIODevice object at 0x02C2EDA0>
obj.eventFilter = <built-in method eventFilter of QIODevice object at 0x02C2EDA0>
obj.findChild = <built-in method findChild of QIODevice object at 0x02C2EDA0>
obj.findChildren = <built-in method findChildren of QIODevice object at 0x02C2EDA0>
obj.getChar = <built-in method getChar of QIODevice object at 0x02C2EDA0>
obj.inherits = <built-in method inherits of QIODevice object at 0x02C2EDA0>
obj.installEventFilter = <built-in method installEventFilter of QIODevice object at 0x02C2EDA0>
obj.isOpen = <built-in method isOpen of QIODevice object at 0x02C2EDA0>
obj.isReadable = <built-in method isReadable of QIODevice object at 0x02C2EDA0>
obj.isSequential = <built-in method isSequential of QIODevice object at 0x02C2EDA0>
obj.isTextModeEnabled = <built-in method isTextModeEnabled of QIODevice object at 0x02C2EDA0>
obj.isWidgetType = <built-in method isWidgetType of QIODevice object at 0x02C2EDA0>
obj.isWritable = <built-in method isWritable of QIODevice object at 0x02C2EDA0>
obj.killTimer = <built-in method killTimer of QIODevice object at 0x02C2EDA0>
obj.metaObject = <built-in method metaObject of QIODevice object at 0x02C2EDA0>
obj.moveToThread = <built-in method moveToThread of QIODevice object at 0x02C2EDA0>
obj.objectName = <built-in method objectName of QIODevice object at 0x02C2EDA0>
obj.open = <built-in method open of QIODevice object at 0x02C2EDA0>
obj.openMode = <built-in method openMode of QIODevice object at 0x02C2EDA0>
obj.parent = <built-in method parent of QIODevice object at 0x02C2EDA0>
obj.peek = <built-in method peek of QIODevice object at 0x02C2EDA0>
obj.pos = <built-in method pos of QIODevice object at 0x02C2EDA0>
obj.property = <built-in method property of QIODevice object at 0x02C2EDA0>
obj.putChar = <built-in method putChar of QIODevice object at 0x02C2EDA0>
obj.pyqtConfigure = <built-in method pyqtConfigure of QIODevice object at 0x02C2EDA0>
obj.read = <built-in method read of QIODevice object at 0x02C2EDA0>
obj.readAll = <built-in method readAll of QIODevice object at 0x02C2EDA0>
obj.readChannelFinished = <bound signal readChannelFinished of QIODevice object at 0x02C2EDA0>
obj.readData = <built-in method readData of QIODevice object at 0x02C2EDA0>
obj.readLine = <built-in method readLine of QIODevice object at 0x02C2EDA0>
obj.readLineData = <built-in method readLineData of QIODevice object at 0x02C2EDA0>
obj.readyRead = <bound signal readyRead of QIODevice object at 0x02C2EDA0>
obj.receivers = <built-in method receivers of QIODevice object at 0x02C2EDA0>
obj.removeEventFilter = <built-in method removeEventFilter of QIODevice object at 0x02C2EDA0>
obj.reset = <built-in method reset of QIODevice object at 0x02C2EDA0>
obj.seek = <built-in method seek of QIODevice object at 0x02C2EDA0>
obj.sender = <built-in method sender of QIODevice object at 0x02C2EDA0>
obj.senderSignalIndex = <built-in method senderSignalIndex of QIODevice object at 0x02C2EDA0>
obj.setErrorString = <built-in method setErrorString of QIODevice object at 0x02C2EDA0>
obj.setObjectName = <built-in method setObjectName of QIODevice object at 0x02C2EDA0>
obj.setOpenMode = <built-in method setOpenMode of QIODevice object at 0x02C2EDA0>
obj.setParent = <built-in method setParent of QIODevice object at 0x02C2EDA0>
obj.setProperty = <built-in method setProperty of QIODevice object at 0x02C2EDA0>
obj.setTextModeEnabled = <built-in method setTextModeEnabled of QIODevice object at 0x02C2EDA0>
obj.signalsBlocked = <built-in method signalsBlocked of QIODevice object at 0x02C2EDA0>
obj.size = <built-in method size of QIODevice object at 0x02C2EDA0>
obj.startTimer = <built-in method startTimer of QIODevice object at 0x02C2EDA0>
obj.staticMetaObject = <PyQt4.QtCore.QMetaObject object at 0x02C4E330>
obj.thread = <built-in method thread of QIODevice object at 0x02C2EDA0>
obj.timerEvent = <built-in method timerEvent of QIODevice object at 0x02C2EDA0>
obj.tr = <built-in method tr of QIODevice object at 0x02C2EDA0>
obj.trUtf8 = <built-in method trUtf8 of QIODevice object at 0x02C2EDA0>
obj.ungetChar = <built-in method ungetChar of QIODevice object at 0x02C2EDA0>
obj.waitForBytesWritten = <built-in method waitForBytesWritten of QIODevice object at 0x02C2EDA0>
obj.waitForReadyRead = <built-in method waitForReadyRead of QIODevice object at 0x02C2EDA0>
obj.write = <built-in method write of QIODevice object at 0x02C2EDA0>
obj.writeData = <built-in method writeData of QIODevice object at 0x02C2EDA0>