
This video gives an overview of the entire course.
Find the most common causes of performance issues in Python applications.
• Distinguish CPU bound tasks and I/O bound tasks
• Use the time Unix command to diagnose performance issues
• Use the cProfile Python module for advanced profiling
Take an existing I/O intensive Python application and speed it up.
• Understand concurrent I/O task execution in Python
• Use a ThreadPollExecutor to parallelize I/O tasks
• Use the time command to check the speed increase
Take an existing CPU intensive Python application and speed it up.
• Understand concurrent CPU task execution in Python
• Use a multiprocessing Pool to parallelize CPU tasks
• Use the time command to check the speed increase
Take an existing CPU intensive Python application and speed it up using a C/C++ library.
• Create a Python extension that calls C/C++ code
• Parse Python arguments in C/C++ and return C/C++ objects to Python
• Use setuptools to build the extension
Speed up a Python application by using an alternative Python implementation.
• Choose an appropriate Python implementation
• Replace C/C++ extensions in your code with plain Python implementations
• Use PyPy to run the refactored application
Prepare your Python module to be distributed to the Python Package index.
• Write the necessary files for setuptools distribution
• Configure module using the setup.py file
• Choose a license for your code
Distribute your Python module to the Python Package Index in 2 popular formats.
• Create and inspect a source distribution from your Python module
• Create and inspect a wheel distribution from your Python module
• Use twine to upload your distributions to the Python Package Index
Distribute a user-facing Python application to end-users in a friendly way.
• Use PyInstaller to generate executables for a command-line application
• Use PyInstaller to generate executables for a GUI application
• Inspect resulting executables
Distribute a web application using Docker images and containers.
• Docker definitions
• Write a Dockerfile for a simple Flask application
• Build a Docker image and run a container
Ensure your code works as expected by writing unit tests.
• Identify the testable units in your code
• Write unit tests using PyTest
• Calculate the coverage to understand what is missing from your tests
In this video, you’ll deal with the complex part of the testing and also include the coverage part.
• Create complex part of the unit testing
• Measure the amount of code which is tested
Ensure that the code you are writing is working correctly right from the start.
• Translate requirements into unit test cases
• Implement the code after writing the tests
• Change the code until the tests are passed
Ensure that your code integrates properly with external units and that any external changes will be caught early.
• Write tests for functionality not units
• Run the tests in production-like environments
• Check test results regularly
Ensure functionality requirements are met throughout the development lifecycle.
• Define features using the Gherkin syntax
• Implement the scenarios using pytest-bdd
• Build the code until the requirements are met
Install application dependencies separately from each other and from the system environment.
• Identify the components of a typical Python installation
• Create separate Python environments with virtualenv
• Use the virtualenvs to isolate application dependencies
Recreate an entire Python environment to use on a different machine.
• Install dependencies in a virtualenv
• Freeze dependencies in a requirements.txt file
• Use pip to recreate the environment based on requirements.txt
Debug Python applications with built-in tools.
Run your application using pdb
Use pdb commands to control the execution
Use the dis module to inspect Python bytecode
Quickly prototype ideas in Python and share interactive prototypes with other developers.
Use the Python shell to research a new library
Use Jupyter to create an interactive prototype
Use Jupyter to visualize data plots
Find stylistic issues in your Python code.
Navigate PEP 8 to understand the common guidelines
Use pylint to check your code for style issues
Customize pylint messages to fit your needs
Check your code for potential bugs before running it and import all reports in one place.
Activate SonarQube Python rules
Use sonar-scanner to check for style issues and potential bugs
Add unit test coverage and results in SonarQube
Check Python types before running the code. Remove run-time type checking.
Identify the need for type checking in Python
Add type hints to your code
Use mypy to check the types before running
Python is a widely used advanced programming language. Over the years, Python has turned out to be a boon for developers and it is very powerful, fast, can run everywhere, and offers flexibility. Hence it is also important to gain insights into this language and use the right tips and tricks while you develop an application, as this makes life easy for developers.
The course starts by dealing with performance issues and learning how to tackle them in an application. Distributing an application with Python is not easy but you will learn ways to distribute applications developed using Python along with GUIs, web applications, and more. Further, you will learn to test your application at different levels and use modern software at the development stage. You will also learn to expand productivity using standard and third-party tools. Finally, you will learn to protect your code quality from potential errors and detect any problem at an early stage, to prevent any issues later.
By the end, of course, you will have learned many tips and tricks while developing an application with Python; you'll excel at this and avoid encountering major problems as a developer. So, grab this course and take your applications to the next level!
About the Author
Mihai Costea is an Automation Technical Team Lead at Telenav GmbH and is from Romania. He has worked with a lot of technologies over a long period. He worked with many startup companies and made a major contribution to them. He has experience in iOS, Python, Go, Docker, jQuery, Android OS development, and many more technologies.