Intro to I/O with Files

I/O == Input and Output

Files == .txt

I and O.jpg

file = file object = variable

open(filename) - filename <string>

file open.jpg

metjod.jpg

hello.jpg


file = open("myFile.txt")
print(file.read())
# hello, how are you? 
# I'm fine, thank you.

print(file.read(5))
# hello

------------------------------------------------------

file = open("myFile.txt")
print(file.read())
print("--------------------")
print(file.read())
# hello, how are you? 
# I'm fine, thank you.
# ------------------------

------------------------------------------------------

file = open("myFile.txt")
print(file.read(5))
print("--------------------")
print(file.read(5))
# hello
# ------------------------
# , how

file seek.jpg