Answers for "how to open a file in python with \"

1

how to read a file in python

# How to read, and print to the screen a file in python!

f = open('fileName', 'r')
print(f.read())
f.close()

# Where "fileName" is obviously the name of your file that you want to read.
Posted by: Guest on August-29-2021
0

statement used to open a file in python

file_object  = open("filename", "mode")
Posted by: Guest on June-08-2020

Code answers related to "how to open a file in python with \"

Python Answers by Framework

Browse Popular Code Answers by Language