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)

Adding modules to the package

Now, let's take look at how to add actual code to the package and look out for a couple of pitfalls to avoid.

Python modules have the same name as objects that they have as filenames, except without the .py suffix. This means that the filenames need to be valid Python variable names and also that they should use letters and symbols that are reliably available across different operating systems. The following screenshot showns an example for this:

So, module names should not start with a number because Python variables are not allowed to start with numbers. Also, it should not use capital letters because some common operating system don't differentiate between filenames containing capital letters and filenames that are all lowercase. As long as we stay within Python variable name guidelines and remember to use a .py suffix, we can name...