当我连接时,我得到奇怪的输出。 当它使用这个:奇怪的文字连接
print 'sadasdadgdsfdajfhdsgsdkjhgsfjhdfdsfds'+'.323232600656520346403'
它工作正常。
,但是当我这样做:
getReference = open('test.txt','r')
for line in getReference:#os.path.exists(''+line+'.txt')
try:
with open(''+line+'.txt') as f: pass
except IOError as e:
newURL ='http://www.intrat.th/'+''.join(line)+'.fsta'
print newURL
当我打印的newURL它不给我一个行的文本,而是它有.fsta在第二行。 这是为什么发生?
谢谢@Andre百隆 – 2012-07-09 18:07:50