【发布时间】:2015-05-16 00:16:11
【问题描述】:
从文件中获取一行并将其拆分时告诉我:
Traceback (most recent call last):
File "C:\Users\service user\Desktop\cmd\main.py", line 94, in <module>
start()
File "C:\Users\service user\Desktop\cmd\main.py", line 66, in start
e = f.split('/')
AttributeError: 'file' object has no attribute 'split'
我的代码在这里:
if split[0] == "/mount":
extract(split[1])
with open("info.m") as f:
f.readlines()
print f
e = f.split('/')
newlang = Conlang(e[0],e[1],e[2],e[3])
f.close()
print "Mounted as %s" % (e[0])
如果您知道它为什么不会分裂,我们将不胜感激。
【问题讨论】:
标签: python file python-2.7 io