>> c=open("nishuo.txt")
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
c=open("nishuo.txt")
FileNotFoundError: [Errno 2] No such file or directory: 'nishuo.txt'
>>> c=open("nishuo.txt","w")
>>> print("我爱你",file=nishuo.txt)
SyntaxError: invalid character in identifier
>>> print("我爱你",file="nishuo.txt")
SyntaxError: invalid character in identifier
>>>
>>> print("我爱你",file=c)
SyntaxError: invalid character in identifier
>>> c.write("我爱你")
3
>>> c.close()
>>> man_file=open("nishuo.txt","a")
>>> a=["wozaini"]
>>> print(a,file=man_file)
>>> man_file.close()
>>> print("wozaini")
wozaini
>>> man_file=open
>>> man_file=open("nishuo.txt","a")
>>> print("nishishenme",file=man_file)
>>> man_file.close()
>>> dk_file=open("nishuo.txt","a")
>>> print("hehehe",file=dk_file)
>>> dk_file.close()
>>>
>>>
2016-10-19 今天试验的代码段
最新推荐文章于 2024-06-09 17:46:54 发布