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

2017python学习的第三天文件的操作

时间:2017-04-27 00:31:18      阅读:363      评论:0      收藏:0      [点我收藏+]

标签:ade   操作   文件的操作   display   open   close   struct   ati   print   

这个是一首歌用来做文件模版的
技术分享
Somehow, it seems the love I knew was always the most destructive kind
不知为何,我经历的爱情总是最具毁灭性的的那种
Yesterday when I was young
昨日当我年少轻狂
The taste of life was sweet
生命的滋味是甜的
As rain upon my tongue
就如舌尖上的雨露
I teased at life as if it were a foolish game
我戏弄生命 视其为愚蠢的游戏
The way the evening breeze
就如夜晚的微风
May tease the candle flame
逗弄蜡烛的火苗
The thousand dreams I dreamed
我曾千万次梦见
The splendid things I planned
那些我计划的绚丽蓝图
I always built to last on weak and shifting sand
但我总是将之建筑在易逝的流沙上
I lived by night and shunned the naked light of day
我夜夜笙歌 逃避白昼赤裸的阳光
And only now I see how the time ran away
事到如今我才看清岁月是如何匆匆流逝
Yesterday when I was young
昨日当我年少轻狂
So many lovely songs were waiting to be sung
有那么多甜美的曲儿等我歌唱
So many wild pleasures lay in store for me
有那么多肆意的快乐等我享受
And so much pain my eyes refused to see
还有那么多痛苦 我的双眼却视而不见
I ran so fast that time and youth at last ran out
我飞快地奔走 最终时光与青春消逝殆尽
I never stopped to think what life was all about
我从未停下脚步去思考生命的意义
And every conversation that I can now recall
如今回想起的所有对话
Concerned itself with me and nothing else at all
除了和我相关的 什么都记不得了
The game of love I played with arrogance and pride
我用自负和傲慢玩着爱情的游戏
And every flame I lit too quickly, quickly died
所有我点燃的火焰都熄灭得太快
The friends I made all somehow seemed to slip away
所有我交的朋友似乎都不知不觉地离开了
And only now Im left alone to end the play, yeah
只剩我一个人在台上来结束这场闹剧
Oh, yesterday when I was young
噢 昨日当我年少轻狂
So many, many songs were waiting to be sung
有那么那么多甜美的曲儿等我歌唱
So many wild pleasures lay in store for me
有那么多肆意的快乐等我享受
And so much pain my eyes refused to see
还有那么多痛苦 我的双眼却视而不见
There are so many songs in me that wont be sung
我有太多歌曲永远不会被唱起
I feel the bitter taste of tears upon my tongue
我尝到了舌尖泪水的苦涩滋味
The time has come for me to pay for yesterday
终于到了付出代价的时间 为了昨日
When I was young
当我年少轻狂
yestherday
技术分享
 1 #!/user/bin/env python
 2 # -*- coding:utf-8 -*-
 3 __author__ = Howie
 4 
 5 
 6 index = 0
 7 with open(yestherday,r,encoding=utf-8) as data:
 8     print(data.readline(),data.tell())
 9     data.seek(10)
10     print(data.readline(),data.tell())
11 
12 
13 
14 
15 
16 
17 ‘‘‘
18     for line in data:
19         index +=1
20         if index <= 9 or index >=13:
21             print(‘----不打印第%s行------‘%index)
22             continue
23         print(index,line.strip())
24 
25 ‘‘‘
26 
27 
28 ‘‘‘
29     for index,line in enumerate(data.readlines()):
30         if index <= 9 or index >=13:
31             print(‘----不打印第%s行------‘%index)
32             continue
33         print(index,line.strip())
34 ‘‘‘
文件的一些操作

 

2017python学习的第三天文件的操作

标签:ade   操作   文件的操作   display   open   close   struct   ati   print   

原文地址:http://www.cnblogs.com/Howardandlili/p/6771654.html

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