Answers for "how to read a file from folder in desktop python"

12

get files in directory python

import os
files_and_directories = os.listdir("path/to/directory")
Posted by: Guest on June-12-2020
0

file.open("file.txt);

myfile = open("example.txt")
txt = myfile.read()
print(txt)
myfile.close()
Posted by: Guest on August-30-2020
0

how to access a txt file through os library in python

my_file_handle=open("folder/test.txt")
my_file_handle.read()
Posted by: Guest on September-22-2020

Code answers related to "how to read a file from folder in desktop python"

Python Answers by Framework

Browse Popular Code Answers by Language