Chinaunix首页 | 论坛 | 博客
  • 博客访问: 388879
  • 博文数量: 199
  • 博客积分: 154
  • 博客等级: 入伍新兵
  • 技术积分: 1530
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 08:43
文章分类

全部博文(199)

文章存档

2015年(101)

2014年(97)

2011年(1)

分类: Python/Ruby

2015-08-03 11:31:47

# 写文件 
with open("test.txt", "wt") as out_file:
    out_file.write("该文本会写入到文件中\n看到我了吧!"
# Read a file 
with open("test.txt", "rt") as in_file:
    text = in_file.read() 
print(text)
阅读(1432) | 评论(0) | 转发(0) |
0

上一篇:显示日历

下一篇:字符串判断

给主人留下些什么吧!~~