1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-01-13 22:42:02 +01:00

Update python.md

This commit is contained in:
Rico Sta. Cruz 2020-06-13 10:09:01 +10:00 committed by GitHub
parent 574355b794
commit 0114a74db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,8 +121,9 @@ category: Python
```py
file = open("hello.txt", "r") # open in read mode 'r'
file.close()
```
---
```py
print(file.read()) # read the entire file and set the cursor at the end of file
print file.readline() # Reading one line
file.seek(0, 0) # place the cursor at the beggining of the file