简体   繁体   English

有人能告诉我 python 中的回车键是什么吗?

[英]Can someone tell me what the enter key is in python?

firmware = input("which image would you like to upload?")
if firmware == 1:
    net_connect.send_config_set("wr")
    net_connect.send_config_set(" copy tftp://cisco@10.36.50.60/s2t54-ipservicesk9-mz.SPA.152-1.SY6.bin bootdisk:")
    print ("Press enter to confirm ")
    # How can I send a enter command to the shell

Sorry I have adjusted the post but I have commented where I need to send the enter key I have already tried print("\n") and I have tried print(" ").抱歉,我已经调整了帖子,但我已经评论了我需要发送回车键的地方我已经尝试过 print("\n") 并且我已经尝试过 print("")。 Both do not work.两者都不起作用。 Can someone please advise:)有人可以建议:)

You can do something like this:你可以这样做:
input("Press the enter key to continue.. ")
Put this wherever you want to confirm or pause.把它放在你想确认或暂停的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM