Book Image

Daniel Arbuckle's Mastering Python

By : Daniel Arbuckle
Book Image

Daniel Arbuckle's Mastering Python

By: Daniel Arbuckle

Overview of this book

Daniel Arbuckle's Mastering Python covers the basics of operating in a Python development environment, before moving on to more advanced topics. Daniel presents you with real-world solutions to Python 3.6 and advanced-level concepts, such as reactive programming, microservices, ctypes, and Cython tools. You don't need to be familiar with the Python language to use this book, as Daniel starts with a Python primer. Throughout, Daniel highlights the major aspects of managing your Python development environment, shows you how to handle parallel computation, and helps you to master asynchronous I/O with Python 3.6 to improve performance. Finally, Daniel will teach you the secrets of metaprogramming and unit testing in Python, helping you acquire the perfect skillset to be a Python expert. Daniel will get you up to speed on everything from basic programming practices to high-end tools and techniques, things that will help set you apart as a successful Python programmer.
Table of Contents (13 chapters)

Advantages and disadvantages of compiled code

There are many real advantages of using compiled code. Python is a very productive language, but it may not fulfil the requirements of a lot of people. Sometimes, we need to interface with code written in a different language. One reason for doing this would be in case we need to access some functionality that is written in a different language that doesn't exist in Python.

As long as the code in question is in a dynamic library that has a C-compatible interface, it's relatively easy to call the code from within Python, using the Foreign Function Interface (FFI) provided by Python's standard ctypes package, which we'll discuss in the next section.

Alternatively, we may need to write some code that runs Close to Metal (CTM), either to maximize the performance of an algorithm that's proven to be a bottleneck...