Answers for "how to find file with specific extension in python"

5

how to search for a specific file extension with python

import glob, os
os.chdir("/mydir")
for file in glob.glob("*.txt"):
    print(file)
Posted by: Guest on March-06-2020
1

simple way of finding file extension python programming

file = input("Which file did you opend last time user:- ")
extenction = file.split(".")
print("humm so last time you opened file extenction was .",extenction[1])
Posted by: Guest on July-26-2021

Code answers related to "how to find file with specific extension in python"

Python Answers by Framework

Browse Popular Code Answers by Language