Web to py enterprise web framework - p 6
45
lượt xem 4
download
lượt xem 4
download

Web to py enterprise web framework - p 6
Mô tả tài liệu

LAMBDA 35 1 2 file = open('myfile.txt', 'w') file.write('hello world') Similarly, you can read back from the file with: 1 2 3 file = open('myfile.txt', 'r') print file.read() hello world Alternatively, you can read in binary mode with "rb", write in binary mode with "wb", and open the file in append mode "a", using standard C notation. The read command takes an optional argument, which is the number of bytes. You can also jump to any location in a file using seek. You can read back from the file with read 1 2 3 print file.seek(6) print file.read() world and you can close the...
Chủ đề:
Bình luận(0) Đăng nhập để gửi bình luận!

CÓ THỂ BẠN MUỐN DOWNLOAD