首页 > 编程语言 > 详细

python学习日记(笨办法) test16

时间:2018-02-05 15:02:34      阅读:209      评论:0      收藏:0      [点我收藏+]
 test16测试代码 #-*- coding: utf-8 -*- from sys import argv script , filename = argv print  "We're gogning to erase %r ."  %  fliename print  "If you don't want that, hit CTRL-C(^C)." print  "If you want that ,hit RETURN." #打开文件 target=open (filename,'w')  #清空文件 target.truncate() #输入三行内容 line1 = raw_input("line 1 :") line2 = raw_input("line 2 :") line3 = raw_input("line 3 :") #将上面三行内容写入文件 target.write(line1) target.write("\n") target.write(line2) target.write("\n") target.write(line3)


python学习日记(笨办法) test16

原文:http://blog.51cto.com/11820620/2068967

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!