我想在我制作的脚本中放入一个变量
说吧
host = 192.168.1.1
我在脚本中的评论是:
tn.write("cpconf tohost=192.168.200.22:XXX \n")
我的要求: 希望改为 XXX 变量将是主机
XXX
怎么办? 使用 Python2.7。
Python2.7
tn.write("cpconf tohost=192.168.200.22:{0} \n".format(host))
工作!谢谢