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)

Python tools to interact with the user

In the previous section, we saw how to get information from the user on the command line, but what do we do when we need a more dynamic form of interaction? So, let's take a look at some of Python's tools for sending information to the user and requesting information from the user.

Python's built-in functions - print and input

The fundamentals of interactivity are simple. We need to be able to tell the user things and we need the user to be able to tell us things. In service of those two goals, Python provides two built-in functions. These are print and input.

Create a simple.py file with the following code:

The print function takes any number of Python objects as parameters...