135-1821-9792

自定义存储目录文件txt,写入文字并输出已输入的文字

dirPath = raw_input("Input your dir path:\n")
write = raw_input("What do you want to write? Please input here:\n")
with open(dirPath+"testDitPath.txt", "w") as f:
    f.write(write)
with open(dirPath+"testDitPath.txt", "r") as r:
    text = r.readline()
print "This is your writed: \n", text

分享标题:自定义存储目录文件txt,写入文字并输出已输入的文字
文章来源:http://wtcwzsj.com/article/jjgsdh.html

其他资讯



Copyright © 2009-2022 www.wtcwzsj.com 青羊区广皓图文设计工作室(个体工商户) 版权所有 蜀ICP备19037934号