python方法的调用_python方法调用

print(dir(ser))打印ser的所有方法,找到inWaiting和in_waiting,没有inwaiting,所以报错。

你确定在外面调用的是inwaiting吗?

['BAUDRATES', 'BYTESIZES', 'PARITIES', 'STOPBITS', '_GetCommModemStatus', '_SAVED_SETTINGS', '__abst

ractmethods__', '__class__', '__del__', '__delattr__', '__dict__', '__dir__', '__doc__', '__enter__'

, '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__'

, '__iter__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__next__', '__reduce__', '__re

duce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_abc_cache', '_

abc_negative_cache', '_abc_negative_cache_version', '_abc_registry', '_baudrate', '_break_state', '_

bytesize', '_cancel_overlapped_io', '_checkClosed', '_checkReadable', '_checkSeekable', '_checkWrita

ble', '_close', '_dsrdtr', '_dtr_state', '_inter_byte_timeout', '_orgTimeouts', '_overlapped_read',

'_overlapped_write', '_parity', '_port', '_port_handle', '_reconfigure_port', '_rs485_mode', '_rts_s

tate', '_rtscts', '_stopbits', '_timeout', '_update_break_state', '_update_dtr_state', '_update_rts_

state', '_write_timeout', '_xonxoff', 'applySettingsDict', 'apply_settings', 'baudrate', 'break_cond

ition', 'bytesize', 'cancel_read', 'cancel_write', 'cd', 'close', 'closed', 'cts', 'dsr', 'dsrdtr',

'dtr', 'fileno', 'flush', 'flushInput', 'flushOutput', 'getCD', 'getCTS', 'getDSR', 'getRI', 'getSet

tingsDict', 'get_settings', 'inWaiting', 'in_waiting', 'interCharTimeout', 'inter_byte_timeout', 'ir

ead_until', 'isOpen', 'is_open', 'isatty', 'name', 'open', 'out_waiting', 'parity', 'port', 'portstr

', 'read', 'read_all', 'read_until', 'readable', 'readall', 'readinto', 'readline', 'readlines', 're

set_input_buffer', 'reset_output_buffer', 'ri', 'rs485_mode', 'rts', 'rtscts', 'seek', 'seekable', '

sendBreak', 'send_break', 'setDTR', 'setPort', 'setRTS', 'set_buffer_size', 'set_output_flow_control

', 'stopbits', 'tell', 'timeout', 'truncate', 'writable', 'write', 'writeTimeout', 'write_timeout',

'writelines', 'xonxoff']

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值