indigokda.blogg.se

File searching software for windows 7
File searching software for windows 7













Let us save the complete code as finder.py (you can also download it from ) and make it a Windows executable ( exe) file using the Pyinstaller module. The rest of the code is very easy to understand. Print “Thanks for using ” Figure 6: Searching used power for regular expressions

file searching software for windows 7

Here, we used the search method of regular expressions so that we can use a regular expression to find the file. Print “Path \t\t: File-name” Figure 4: File searching Figure 5: File searching using regular expressions Next time, when you search any file, the program will search the file in the dumped dictionary, as follows: if len(sys.argv) 2:įile_to_be_searched = () Process1 = Thread(target=search1, args=(each,))Īfter creating the dictionary, the following code dumps the dictionary into the hard disk as a pickle file. The create function opens the thread process for each drive, and each thread process calls the search1 function. def search1(drive):įor root, dir, files in os.walk(drive, topdown = True): Our next function is the search1 function, which constructs a dictionary in which the file name is the key and the path is the value of the dictionary. Return list1 Figure 2: Creating exe file of the Python program Figure 3 Creating a database of all files Response = os.popen("wmic logicaldisk get caption") If you have inserted any external/USB pen drive or hard drive disk, the function also obtains details for them. This function gets all the drives in your Windows machine. Next, let’s write a function to acquire the drives. # email-id block of code below imports the essential modules: import osĭict1 = Figure 1: Program logic for Faster file search with Python I have broken it into different functions. Now that you have understood the logic of the program, let us look at the program in detail. The next time, the file will be searched in the dictionary (dumped in the pickle file). The dictionary will be dumped into the pickle file. Let us first do indexing or, in Python language terms, let’s construct a dictionary in which the file will be the key of the dictionary and the value will be the path of the file. Let us first understand the program’s logic.

file searching software for windows 7

In this article, I will give you a Python program which will search a file on your computer’s hard disk, within hardly one second. The Explorer in Windows 7 offers a search facility but it takes around two to three minutes to search a file. Read on to discover how it works and how it can be used in Windows systems.Ĭomputer users often have a problem with file search as they tend to forget the location or path of a file even though Windows provides a file search utility. This article presents a file search utility created by using the power of the versatile Python programming language.















File searching software for windows 7