Answers for "print file contents in python"

1

code for showing contents of a file and printing it in python

import os

with open("filename", "r+") as file:
    content = file.readline()
    while(content!=""):
      	print(content)
        content = file.readline()
    file.close
Posted by: Guest on August-05-2020

Code answers related to "print file contents in python"

Python Answers by Framework

Browse Popular Code Answers by Language