Skip to content

Commit 0bd3ccf

Browse files
Create db_lookup_v1.5.py
1 parent 2b3987f commit 0bd3ccf

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

db_lookup_v1.5.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python
2+
#|---------------------------------------------------------------|#
3+
#| Usage: python db_lookup.py <database.sql> <string_to_search> |#
4+
#| Simple database lookup | by Chris Poole |#
5+
#|---------------------------------------------------------------|#
6+
7+
import sys
8+
9+
if len(sys.argv) < 2:
10+
sys.exit("\033[37mUsage: python "+sys.argv[0]+" <database.sql> <string_to_search>")
11+
12+
print '''\033[32m
13+
| --: Please enter username/email/password or any :-- |
14+
| --: string you want to look for. :-- |
15+
\033[37m'''
16+
print("\033[31m| --: Devloped by Chris Poole | @codingplanets :-- |\033[37m")
17+
18+
string = str(sys.argv[2])
19+
20+
with open(sys.argv[1], 'r') as data:
21+
for grep in data:
22+
if string in grep:
23+
print grep

0 commit comments

Comments
 (0)