编程语言
首页 > 编程语言> > 记第一个问题——python文件无法写入数据

记第一个问题——python文件无法写入数据

作者:互联网

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也无法写入

标签:文件,python,please,写入,getpass,read,input,password,fo
来源: https://www.cnblogs.com/ansue-home/p/11886460.html