Guys ,
I was studying a book named accidental billioners and found how Zuckerberg sir had hacked university sites and found the whole data. But the problem he found that it was very large data how he will be able to find all the images at one place. Then he thought of an python script. He wrote and execute it then he found all the JPEG, PNG or other image files at one place. I dont know in details how he did that. But I have a python script that shows you all your files in particular directory and with particular extension. here it is.
import glob, oss
for root, dirs, files in os.walk("E:\\"):
for file in files:
if file.endswith(".txt"):
print(os.path.join(root, file))
Save this file on notepad by putting dot ".py"extension.
For testing-
1- Obviously you will need python which you can download from- Python org
2- You need to store path variable if you are using windows.
3- Then You'll need to start 'cmd'. then write your file path where you have save your python file. Suppose I have saved my file in C:\user\NST>
and I have save its name- search1.py
then it will look something like this-
When you will click 'enter' button you will get results like this.
If you want to search some other extensions then in this statement "if file.endswith(".txt"):" replace '.txt' with the file extension you want to search and you will find similar extension files address.
I was studying a book named accidental billioners and found how Zuckerberg sir had hacked university sites and found the whole data. But the problem he found that it was very large data how he will be able to find all the images at one place. Then he thought of an python script. He wrote and execute it then he found all the JPEG, PNG or other image files at one place. I dont know in details how he did that. But I have a python script that shows you all your files in particular directory and with particular extension. here it is.
import glob, oss
for root, dirs, files in os.walk("E:\\"):
for file in files:
if file.endswith(".txt"):
print(os.path.join(root, file))
Save this file on notepad by putting dot ".py"extension.
For testing-
1- Obviously you will need python which you can download from- Python org
2- You need to store path variable if you are using windows.
3- Then You'll need to start 'cmd'. then write your file path where you have save your python file. Suppose I have saved my file in C:\user\NST>
and I have save its name- search1.py
then it will look something like this-
When you will click 'enter' button you will get results like this.
If you want to search some other extensions then in this statement "if file.endswith(".txt"):" replace '.txt' with the file extension you want to search and you will find similar extension files address.
Comments
Post a Comment