>>>list = ['i','am','a','boy']
>>>file = open('test.txt','w+')
>>>file.write(repr(list))
>>>file.close()
>>>print open('test.txt').read()
['i', 'am', 'a', 'boy']
欢迎分享,转载请注明来源:内存溢出
>>>list = ['i','am','a','boy']
>>>file = open('test.txt','w+')
>>>file.write(repr(list))
>>>file.close()
>>>print open('test.txt').read()
['i', 'am', 'a', 'boy']
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)