Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get all files in pc python

import os
 
 
counter = 0
print("If you want all the excel file, for example write .xlsx")
inp = input("What are you looking for?:> ")
thisdir = os.getcwd()
for r, d, f in os.walk("C:"): # change the hard drive, if you want
    for file in f:
        filepath = os.path.join(r, file)
        if inp in file:
        	counter += 1
        	print(os.path.join(r, file))
print(f"trovati {counter} files.")
Comment

PREVIOUS NEXT
Code Example
Python :: access env variable in flask 
Python :: how to reset username and password in django admin 
Python :: max int python 
Python :: python empty constructor 
Python :: cv2.copyMakeBorder 
Python :: create a empty dataframe 
Python :: python thread stop 
Python :: save model python 
Python :: install python3 in ubuntu 
Python :: python text reverse 
Python :: get ip address python 
Python :: how to clear the list in python 
Python :: How do I iterate over a subfolder in Python 
Python :: django meta attributes 
Python :: how to make a terminal in python 
Python :: fibonacci recursive python 
Python :: how to copy file from local to sftp using python 
Python :: python extract string 
Python :: python turtle fill 
Python :: beautifulsoup check if text exists 
Python :: how to use the super 
Python :: conda create environment python 3 
Python :: overriding update in serializer django 
Python :: days in month function python 
Python :: sklearn regression 
Python :: numpy generate random array 
Python :: fastapi upload file save 
Python :: fillna not work 
Python :: lambda function in python 
Python :: iterate through a list 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =