问题
On a real device when I want to access "show gpon onu state" it takes a few presses of the space bar to get to the end of the line. for paramiko how to eliminate the word "more" so that you get to the end of the line?
回答1:
There are several solution type for this case:
Each brand has a screen-length command for this issue. You can enter this command first.
- Cisco:
terminal length 0
- Huawei :
screen-length 0 temporary
- Nokia/Alcatel :
environment no more
cmd.send("terminal length 0" + '\r') time.sleep(1)
- Cisco:
You can send the space or enter command after your actual command. Space command gives you several lines, enter command gives you one line more.
cmd.send("display interface description" + '\r') time.sleep(1) cmd.send(" " + '\r') time.sleep(1) cmd.send(100 * '\r') time.sleep(1)
来源:https://stackoverflow.com/questions/60704144/how-to-proceed-with-the-word-more-to-get-to-the-end-of-the-command