Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Daniel Arbuckle???s Mastering Python
  • Table Of Contents Toc
Daniel Arbuckle???s Mastering Python

Daniel Arbuckle???s Mastering Python

By : Daniel Arbuckle
5 (1)
close
close
Daniel Arbuckle???s Mastering Python

Daniel Arbuckle???s Mastering Python

5 (1)
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)
close
close

Making a package executable via Python -m

In the previous chapter, we ran command-line tools, such as doctest and venv, by typing in the python3 -m command followed by the name of the tool we wanted it to run:

What were we actually asking Python to do when we did that?

The -m command-line switch for Python tells it to run a module. It uses the same mechanism to find the module that it would if we'd used an import statement with the module's name and then it executes it.

However, venv isn't a module, it's a package. So, what's happening when we use python -m venv? We gave Python a package name, but we didn't give it a module name inside the package that it should run. When that happens, Python looks for a module named __main__ in the package and runs that:

So, python -m venv means the same thing as python -m venv.__main__.

Any module that's...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Daniel Arbuckle???s Mastering Python
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon