In[105]:f1=open(‘/tmp/passwd‘,‘r+‘)读写方式打开In[106]:f1.next()读一行,next陆续往下读,不会移动行指标Out[106]:‘root:x:0:0:root:/root:/bin/bash\n‘In[107]:f1.seek(0,2)从文件末尾行(2)偏移位置0(0),f1.seek(0)回到开始处In[109]:f1.tell()查看文件位置(字节)Ou..
分类:
编程语言 时间:
2016-03-24 13:25:31
阅读次数:
192
Description Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undir
分类:
其他好文 时间:
2016-03-10 23:35:20
阅读次数:
189
/*获取文件中存取的数据内容的大小(字节数) ellg() 和 tellp() 这两个成员函数不用传入参数,返回pos_type 类型的值(根据ANSI-C++ 标准) ,就是一个整数,代表当前get 流指针的位置 (用tellg) 或 put 流指针的位置(用tellp). seekg() 和se
分类:
其他好文 时间:
2016-03-03 17:41:26
阅读次数:
112
tell application "Safari" set theURL to URL of front document set the clipboard to theURL & return end tell property theURL : "" tell application "Saf
分类:
其他好文 时间:
2016-03-01 07:27:47
阅读次数:
163
1.StringIO模块StringIO用于像文件一样对字符串缓冲区或者叫做内存文件进行读写。f=StringIO()#readyforwritingf=StringIO(buf)#readyforreadingf.close()#explicitlyreleaseresourcesheldflag=f.isatty()#alwaysfalsepos=f.tell()#getcurrentpositionf.seek(pos)#setcurrentpo..
分类:
编程语言 时间:
2016-02-28 01:05:09
阅读次数:
462
The Unique MST Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 19941 Accepted: 6999 Description Given a connected undirected graph, tell if
分类:
其他好文 时间:
2016-02-18 19:49:28
阅读次数:
177
// Tell the media scanner about the new file so that it is // immediately available to the user. MediaScannerConnection.scanFile(this, new String[] {
分类:
其他好文 时间:
2016-02-17 11:04:25
阅读次数:
159
If you go in Run > Edit Configurations... And select All Specs in <Your Project> you'll see Filename Mask: **/*_spec.rb This means when you tell RubyM
分类:
其他好文 时间:
2016-02-10 16:32:05
阅读次数:
293
Jam's balance Problem Description Jim has a balance and N weights. (1≤N≤20)The balance can only tell whether things on different side are the same wei
分类:
其他好文 时间:
2016-01-31 02:44:36
阅读次数:
238
f=open('test'.txt','w')//写入文件f=open('test.txt','a')//追加写入文件read()一次性读取readline()读取一行readlines()读取一行,并保留为一个list里面seek(0)文件指针指向开头tell()显示目前指针位置os和stat模块...
分类:
编程语言 时间:
2016-01-08 21:51:11
阅读次数:
233