Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Python for Networking and Security

You're reading from   Mastering Python for Networking and Security Leverage Python scripts and libraries to overcome networking and security issues

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher Packt
ISBN-13 9781788992510
Length 426 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
José Manuel Ortega José Manuel Ortega
Author Profile Icon José Manuel Ortega
José Manuel Ortega
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Working with Python Scripting 2. System Programming Packages FREE CHAPTER 3. Socket Programming 4. HTTP Programming 5. Analyzing Network Traffic 6. Gathering Information from Servers 7. Interacting with FTP, SSH, and SNMP Servers 8. Working with Nmap Scanners 9. Connecting with the Metasploit Framework 10. Interacting with the Vulnerabilities Scanner 11. Identifying Server Vulnerabilities in Web Applications 12. Extracting Geolocation and Metadata from Documents, Images, and Browsers 13. Cryptography and Steganography 14. Assessments 15. Other Books You May Enjoy

The main development environments for script-development

In this section, we will review Pycharm and WingIDE as development environments for python scripting.

Setting up a development environment

Pycharm

PyCharm is an IDE developed by the company Jetbrains, and is based on IntelliJ IDEA, the IDE of the same company, but focused on Java and is the base for Android Studio.

PyCharm is multi-platform and we can find binaries for Windows, Linux, and macOS X. There are two versions of PyCharm: community and professional, with differences in features related to integration with web frameworks and database support.

In this url we can see a comparison between community and professional edition: http://www.jetbrains.com/pycharm

The main advantages of this development environment are:

  • Autocomplete, syntax highlighter, analysis tool and refactoring.
  • Integration with web frameworks such as Django, Flask, Pyramid, Web2Py, jQuery, and AngularJS.
  • Advanced debugger.
  • Compatible with SQLAlchemy (ORM), Google App Engine, Cython.
  • Connection with version-control systems: Git, CVS, Mercurial.

WingIDE

WingIDE is a multi-platform environment available for Windows, Mac, and Linux and provides all the functionalities at the level of debugging and variables-exploration.

WingIDE has a rich feature set that will easily support the development of sophisticated Python Applications. With WingIDE, you are able to inspect variables, stack arguments, and memory locations without the process changing any of their values before you can record them. Breakpoints are the most common feature that you will use when debugging a process. Wing Personal is the free version of this Python IDE, which can be found at https://wingware.com/downloads/wingide-personal

WingIDE uses the Python configuration installed in your system:

Debugging with WingIDE

In this example, we are debugging a Python script that accepts two input parameters:

An interesting topic is the possibility of adding a breakpoint in our program with the option Add Breakpoint option, in this way, we can debug and see the contents of the variables just at the point where we have established the breakpoint:

We can set a breakpoint in the call to the view_parameters method.

To execute a script in debug mode with parameters, you have to edit the properties of the script and add the parameters that our script needs within the debug tag:

If we execute in debug mode with a breakpoint inside the function, we can see the content of the parameters in local string variables:

In the following screenshot we can visualize the values of the params variable that contains the values we are debugging:

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime