
Source code for the book "Violent Python" by TJ O'Connor. The code has been fully converted to Python 3, reformatted to comply with PEP8 standards and refactored to eliminate dependency issues involving the implementation of deprecated libraries.
Source code for the book "Violent Python" by TJ O'Connor. The code has been fully converted to Python 3, reformatted to comply with PEP8 standards and refactored to eliminate dependency issues involving the implementation of deprecated libraries.
A conversion similar to this one has been made available by myself on the source code of the book "Black Hat Python", by Justin Seitz. Check it out here if you haven't done it yet.
Simply make a new directory (DIR) for the project, create a new
virtual environment or venv for it (recommended), clone this repository
using git clone and install the requirements using pip install.
user@host:~/DIR$ git clone https://github.com/EONRaider/violent-python3
user@host:~/DIR$ python3 -m venv venv
user@host:~/DIR$ source venv/bin/activate
(venv) user@host:~/DIR$ pip install -r requirements.txt
optparse library has been replaced for argparse
throughout the entire source code. All argument parsing is now contained
under the __main__ execution scope for each file. All CLI arguments that were
mandatory for the execution of scripts but were treated as optional in the
original code are now implemented as positional. A usage prompt is now
available for all scripts that use argparse by supplying a -h argument to
the CLI. Leaving the responsibilities of both boundary and controller
object to the CLI parser is definitely not the best choice in terms
of software architecture, but was left as-is due to the
necessity of conformity to the original coder's intent.PEP 8: E722 do not use bare except violations have
been refactored with more specific exception clauses.close() method on the open file/database objects. For
this
reason all instances of file and database manipulation have been refactored by
using context managers.# -*- coding: utf-8 -*-) was eliminated due to the
standardization of UTF-8 as the default encoding for Python 3 (replacing
ASCII from Python 2).