1 f=open('my_heart_will_go_on','r',encoding='utf-8')#f 是文件句柄,默认是只读模式r,w是写模式——创建方式,会覆盖文件本身 2 #a是append追加模式不会覆盖原文件本身 3 print(f.tell())#文件打开在什么位置。0代表在文件列 ...
分类:
其他好文 时间:
2017-10-16 02:15:12
阅读次数:
133
*** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's d ...
分类:
其他好文 时间:
2017-10-11 10:56:22
阅读次数:
172
str = "test.py" file = open(str, "rw") r读w写b二进制+读写 file.read()读文件 file.write(str)写文件 file.seek(偏移量,文件起始位置) 0文件开头 1当前位置 2文件末尾 file.tell()当前位置 ...
分类:
编程语言 时间:
2017-10-09 22:34:30
阅读次数:
158
文件操作:读:f = open("file1","r",encoding="utf-8") f.read() 全部读,并且是字符串形式。 f.readline()--读第一行f.readline()--读第二行f.readlines()-全部读出来,并且是列表形式。print(f.tell())-- ...
分类:
编程语言 时间:
2017-10-09 22:34:24
阅读次数:
202
github commit时出现 Please tell me who you are..... 第一种设置全局的, 直接在命令行输入 git config --global user.email "you@example.com" git config --global user.name "Yo ...
分类:
其他好文 时间:
2017-10-03 22:19:53
阅读次数:
246
Recently yifenfei face such a problem that give you millions of positive integers,tell how many pairs i and j that satisfy F[i] smaller than F[j] stri ...
分类:
其他好文 时间:
2017-09-24 19:16:42
阅读次数:
194
1.实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。 bad='''your butt is mine I Gonna tell you right Just show your face In broad dayl ...
分类:
其他好文 时间:
2017-09-20 23:12:07
阅读次数:
153
题目链接 Tell Your World 题意 给出N个点(i, xi),问是否存在两条平行的直线,使得每一个点恰好在两条直线的其中一条上。 每条直线必须穿过至少一个点。 考虑每个点和第1个点的斜率,相同的用并查集弄成一个连通块。 然后我们枚举每个连通块,判断不在连通块内的这些点是否在同一条直线上, ...
分类:
其他好文 时间:
2017-09-09 19:38:09
阅读次数:
138
I am a little tempted, but so afraid to look in your eyes. 我对你有一点动心,却如此害怕看你的眼睛。 Now that you are tempted, why not be a little braver? Just tell her yo ...
分类:
其他好文 时间:
2017-09-08 00:18:51
阅读次数:
135
自己总结一下继承的格式 class Father: def__init__(self,Y1,Y2): self.X1=Y1 selfX2=Y2 def tell(self): print’this is “%s”and”%s”:’%(self.X1,self.X2) class son(Father ...
分类:
编程语言 时间:
2017-09-06 13:08:02
阅读次数:
155