Use seek() to move file pointer,seekpointer,f = open('/t
Use seek() to move file pointer,seekpointer,f = open('/t
f = open('/tmp/workfile', 'r+')f.write('0123456789abcdef')f.seek(5) # Go to the 6th byte in the fileprint f.read(1) f.seek(-3, 2) # Go to the 3rd byte before the endprint f.read(1)f.close()
相关内容
- Define class to deal with files,definedeal,class FileSt
- A tuple with one item: a comma,tuplecomma,# A tuple wi
- File read() Demo,filereaddemo,f = open(r'c
- File writelines(list),filewritelines,f = open(r'c
- Using Lists as Stacks,listsstacks,#To add an i
- if-else structure,if-else,print 'passw
- Extracting the Ingredients from a Recipe with Regular Expressions,,
- for statement calls iter() on the container object,itercontainer,fo
- Button mouse action: mouse in, out and rollover,mouserollover,# But
- Warning bmp on a Label,warninglabel,from Tkinter
评论关闭