码迷,mamicode.com
首页 > 编程语言 > 详细

Python:文件操作

时间:2016-09-26 19:36:38      阅读:94      评论:0      收藏:0      [点我收藏+]

标签:

#!/usr/bin/python3

str1 = input("请输入:")
print("你输入的是:",str1)


f=open("abc.txt","a")
f.write("python study is good\n我正在学习中\n")
f.close()


fr=open("abc.txt","r")
str2=fr.readline()
#str2=fr.readlines()
print("abc.txt:")
print(str2)
fr.close()

 

Python:文件操作

标签:

原文地址:http://www.cnblogs.com/qin1991/p/5910184.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!