Closed mrli20182018 closed 5 years ago
i think u must del lead space in
mk.talk_word('/ip/service/print')
its looks like
mk.talk_word(' /ip/service/print')
can you try this code?
res = await mk.read(256) # or 64 or something
print(res.decode())
我认为你必须在
mk.talk_word('/ip/service/print')
它的外观中引领空间mk.talk_word(' /ip/service/print')
你能试试这段代码吗?
res = await mk.read(256)#或64或 print(res.decode())
我是新手
能返回所有结果吗?
This should help
res = await mk.read(1024)
Its low level function. I think , in the next version I will make a function to read the full response
OK. I have released a new version 0.0.8. Now the function "read" parses the answer with flag parse=True (default behavior)
res = await mk.read()
print(res)
if you need original response
res = await mk.read(parse=False)
print(res.decode())
好。 我发布了0.0.8的新版本。现在函数“read”用flag parse = True解析答案(默认行为)
res = await mk.read() print(res)
如果你需要原始回复
res = await mk.read(parse = False) print(res.decode())
不是返回所有?
Fixed in v 0.0.9
if you want to see full personse:
res = await mk.read(full_answer=True)
result:
('!re', None, {'.id': '*8', 'name': 'winbox', 'port': 8291, 'address': '', 'invalid': False, 'disabled': False})
('!re', None, {'.id': '*9', 'name': 'api-ssl', 'port': 8729, 'address': '', 'certificate': 'none', 'invalid': False, 'disabled': False})
('!done', None, {})
without this params:
res = await mk.read()
{'.id': '*8', 'name': 'winbox', 'port': 8291, 'address': '', 'invalid': False, 'disabled': False}
{'.id': '*9', 'name': 'api-ssl', 'port': 8729, 'address': '', 'certificate': 'none', 'invalid': False, 'disabled': False}
这就是我要的
谢谢
api语法我还不是很会
Thank you for testing
请问怎么使用?