#coding=utf-8
poem = "\t I'm trying to writ this into my file,,ooo"
def method_one():
f = open('new.txt', 'w') #open new.txt as file 确认在终端,你已经cd进入了文件所在文件夹。否则Open不出来
f.write(poem) #write poem into f
f.close() #close my file
def method_two():
from sys import argv
script, new = argv
f = open(new, 'w')
f.write(poem)
f.close()
method_two()
读写文件,python. learn python the hard way
最新推荐文章于 2024-08-20 13:35:45 发布