Update python.md
This commit is contained in:
parent
574355b794
commit
0114a74db2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue