我使用这行代码:
fwhost1 = "172.16.17.1"
print("Connecting via API call, backing up the configuration for:", fwhost1)
该行的输出为:
('Connecting via API call, backing up the configuration for:', '172.16.17.1')
我希望在脚本运行时,输出中不会出现括号和单引号。你知道吗
谢谢
我尝试过调整代码行,但这是它运行时不会出错的唯一方法
Tags:
可以使用
+
运算符连接字符串。更多信息here下面是另一种使用格式打印的方法
另一个选项是使用
str.format()
如果您使用的是python3,那么可以使用f-strings
输出
一种更具python风格的方法是在字符串上使用
format
函数相关问题 更多 >
编程相关推荐