【发布时间】:2014-10-31 17:10:45
【问题描述】:
我有这个代码
with open ('ip.txt') as ip :
ips = ip.readlines()
with open ('user.txt') as user :
usrs = user.readlines()
with open ('pass.txt') as passwd :
passwds = passwd.readlines()
with open ('prefix.txt') as pfx :
pfxes = pfx.readlines()
with open ('time.txt') as timer :
timeout = timer.readline()
with open ('phone.txt') as num :
number = num.readline()
打开所有这些文件并将它们加入这个形状
result = ('Server:{0} # U:{1} # P:{2} # Pre:{3} # Tel:{4}\n{5}\n'.format(b,c,d,a,number,ctime))
print (result)
cmd = ("{0}{1}@{2}".format(a,number,b))
print (cmd)
我想它会这样打印
Server:x.x.x.x # U:882 # P:882 # Pre:900 # Tel:456123456789
900456123456789@x.x.x.x
但是输出是这样的
Server:x.x.x.x
# U:882 # P:882 # Pre:900
# Tel:456123456789
900
456123456789@187.191.45.228
新输出:-
Server:x.x.x.x # U:882 # P:882 # Pre:900 # Tel:['456123456789']
900['456123456789']@x.x.x.x
我该如何解决这个问题?
【问题讨论】: