From 2b39192bee3f5f4c520ec4afc8baa648a9d06fb5 Mon Sep 17 00:00:00 2001 From: D4Vinci Date: Tue, 31 Jan 2017 14:52:11 +0200 Subject: [PATCH 1/2] Fixing some typos for better and ... and adding how to install the best libraries to coloring in windows --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ffabca..9e5d2bd 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,8 @@ These dependencies can be installed using the requirements file: - Installation on Windows: ``` -c:\python27\python.exe -m pip install -r requirements.txt +python -m pip install -r requirements.txt ``` - - Installation on Linux ``` sudo pip install -r requirements.txt @@ -44,7 +43,7 @@ Alternatively, each module can be installed independently as shown below. - Install for Windows: ``` -c:\python27\python.exe -m pip install requests +python -m pip install requests ``` - Install for Ubuntu/Debian: @@ -66,7 +65,7 @@ sudo pip install requests - Install for Windows: ``` -c:\python27\python.exe -m pip install dnspython +python -m pip install dnspython ``` - Install for Ubuntu/Debian: @@ -96,6 +95,17 @@ sudo yum install python-argparse sudo pip install argparse ``` +**And for coloring in windows install the following libraries** +``` +python -m pip install win_unicode_console colorama +``` + +*Note:To get the path of python.exe for the windows installation process use :* +``` +import sys +sys.executable +``` + ##Usage Short Form | Long Form | Description From bd558502bbf98937660d445e34ee37a76be75e00 Mon Sep 17 00:00:00 2001 From: D4Vinci Date: Tue, 31 Jan 2017 15:06:12 +0200 Subject: [PATCH 2/2] Making it able to use coloring in windows too ;) --- sublist3r.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sublist3r.py b/sublist3r.py index 2442832..2b90971 100644 --- a/sublist3r.py +++ b/sublist3r.py @@ -42,8 +42,21 @@ is_windows = sys.platform.startswith('win') # Console Colors if is_windows: - # use no terminal colors on windows - G = Y = B = R = W = G = Y = B = R = W = '' + # Windows deserve coloring too :D + G = '\033[92m' # green + Y = '\033[93m' # yellow + B = '\033[94m' # blue + R = '\033[91m' # red + W = '\033[0m' # white + try: + import win_unicode_console , colorama + win_unicode_console.enable() + colorama.init() + #Now the unicode will work ^_^ + except: + print("[!] Error: Coloring libraries not installed ,no coloring will be used [Check the readme]") + G = Y = B = R = W = G = Y = B = R = W = '' + else: G = '\033[92m' # green