千家信息网

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

发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,dirPath = raw_input("Input your dir path:\n")write = raw_input("What do you want to write? Please in
千家信息网最后更新 2025年02月03日自定义存储目录文件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


0