记第一个问题——python文件无法写入数据
标签:写入 问题 第一个 inpu put 文件 pytho user 解决
import getpass username = input("please input your name:") password = getpass.getpass("please input the password:") fo = open("homework01.txt","a ") print(username) print(password) fo.write(username) fo.write(password) fo_read = fo.read() print(fo_read) fo.close() Console: please input your name:Ansue please input the password:123456 Ansue 123456 .....hello也无法写入 —————————————————————————————— 在文件里写入了hello就ok了,但是用a 的模式仍然会把里面的数据重置,好吧,第一个问题竟然是好久之前就遇到而一直没有解决的,一头雾水记第一个问题——python文件无法写入数据
标签:写入 问题 第一个 inpu put 文件 pytho user 解决
温馨提示: 本文由杰米博客推荐,转载请保留链接: https://www.jmwww.net/file/biancheng/12182.html
- 上一篇:数组模拟栈
- 下一篇:冒泡排序Bubble_Sort