Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

[SOURCE]A very simple file finder[/SOURCE]

Hello everyone, i was just finding a text file where i had saved my all bookmarks but i couldn't find that so i though i should program something to automate ma task, so i coded a very simple python program.

Code
import os

my_file = raw_input("Enter the filename: ")

for folderName, subfolders, filenames in os.walk('/home/'):
    for files in filenames:
        if my_file in files:
            print("File exists in " + os.path.join(folderName, my_file))
            continue

If you think it can be more awesome then do whatever changes you can make or you can post similar program to this
For the future... Use the shell command `find /base/dir -iname 'name'`.
Example: find /home/ -iname 'bookmarks.txt'

I love this user <3
Spoiler (Click to View)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by ClumsyApr 29, 2025 07:38 PM 6 372 Apr 29, 2025 07:38 PM
Last Post: Clumsy
[.NET] by ThatOneManInBlackMar 24, 2017 03:35 PM 8 825 Mar 24, 2017 03:35 PM
Last Post: ForceJew
[.NET] by GiommiMay 23, 2015 10:17 AM 28 2,244 May 23, 2015 10:17 AM
Last Post: Giommi