日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

Python获取类属性及其它(vim看源码常用、__dict__)

發(fā)布時(shí)間:2025/3/15 python 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Python获取类属性及其它(vim看源码常用、__dict__) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

假如現(xiàn)在類的名字為protocol

查看protocol屬性

print (protocol.__dict__)

查看protocol的key

print (protocol.__dict__.keys())

{'historyPosition': 1, 'lineBufferIndex': 0, 'historyLines': [b'2222'], 'keyHandlers': {b'\x10': <bound method HistoricRecvLine.handle_UP of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\r': <bound method HoneyPotInteractiveProtocol.handle_RETURN of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[LEFT_ARROW]': <bound method RecvLine.handle_LEFT of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x08': <bound method RecvLine.handle_BACKSPACE of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x01': <bound method RecvLine.handle_HOME of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x1b': <bound method HoneyPotInteractiveProtocol.handle_ESC of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[END]': <bound method RecvLine.handle_END of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x15': <bound method HoneyPotInteractiveProtocol.handle_CTRL_U of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x16': <bound method HoneyPotInteractiveProtocol.handle_CTRL_V of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x02': <bound method RecvLine.handle_LEFT of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[UP_ARROW]': <bound method HistoricRecvLine.handle_UP of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x05': <bound method RecvLine.handle_END of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x7f': <bound method RecvLine.handle_BACKSPACE of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[RIGHT_ARROW]': <bound method RecvLine.handle_RIGHT of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x0b': <bound method HoneyPotInteractiveProtocol.handle_CTRL_K of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\t': <bound method HoneyPotInteractiveProtocol.handle_TAB of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[INSERT]': <bound method RecvLine.handle_INSERT of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[DOWN_ARROW]': <bound method HistoricRecvLine.handle_DOWN of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\n': <bound method HoneyPotInteractiveProtocol.handle_RETURN of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[DELETE]': <bound method RecvLine.handle_DELETE of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'[HOME]': <bound method RecvLine.handle_HOME of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x03': <bound method HoneyPotInteractiveProtocol.handle_CTRL_C of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x0e': <bound method HistoricRecvLine.handle_DOWN of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x04': <bound method HoneyPotInteractiveProtocol.handle_CTRL_D of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x06': <bound method RecvLine.handle_RIGHT of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>, b'\x0c': <bound method HoneyPotInteractiveProtocol.handle_CTRL_L of <cowrie.shell.protocol.HoneyPotInteractiveProtocol object at 0x7fd25878db00>>}, 'hostname': 'zy03', 'environ': {'TERM': 'xterm', 'TMOUT': '1800', 'HOME': '/root', 'LOGNAME': 'root', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'SHELL': '/bin/bash', 'USER': 'root'}, 'realClientIP': '192.168.32.206', 'password_input': False, 'clientIP': '192.168.32.206', 'kippoIP': '192.168.32.109', 'cmdstack': [<cowrie.shell.honeypot.HoneyPotShell object at 0x7fd258714c50>], 'cwd': '/root', 'ps': (b'root@zy03:~# ', b'> '), 'terminal': <cowrie.insults.insults.LoggingServerProtocol object at 0x7fd25878d8d0>, 'pp': None, 'logintime': 1565255526.4570975, 'realClientPort': 3372, 'fs': <cowrie.shell.fs.HoneyPotFilesystem object at 0x7fd258e77470>, 'data': None, 'lineBuffer': [], '_TimeoutMixin__timeoutCall': <DelayedCall 0x7fd258714c18 [178.4536166191101s] called=0 cancelled=0 TimeoutMixin.__timedOut()>, 'user': <cowrie.shell.session.SSHSessionForCowrieUser object at 0x7fd258e77da0>, 'timeOut': 180, 'factory': None, 'mode': 'insert'}

總結(jié)

以上是生活随笔為你收集整理的Python获取类属性及其它(vim看源码常用、__dict__)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。