ebook img

PYTHON The Complete Manual: The essential handbook for Python users PDF

132 Pages·2016·8.76 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview PYTHON The Complete Manual: The essential handbook for Python users

rg o The Complete Manual s. e The essential handbook for n Python users zi Master Python a today! g a llm .a w w w g a llm .a w w w rg o s. e n zi a rg .o Welcome sto e Python n The Complete Manual zi a g a Python is a versatile language and its rise in popularity is certainly no surprise. Its similarity to everyday language has made it a perfect companion for the Raspberry Pi, which is often a irst step into practical programming. But don’t be fooled by its beginner-friendly credentials – Python has plenty of more advanced functions. In this bookazine, you will learn how to program in Python, discover amazing projects to improve your understanding, and ind ways to use Python to enhance your experience of computing. You’ll also create fun projects including programming a quadcopter drone and sending text messages from Raspberry Pi. Let’s get coding! llm .a w w w g a llm .a w w w rg o s. e n zi a Contents What you can ind inside the bookazine g a llm .a w w w 6 rg o s. e n zi a Code & create with Python! rg Get.o started s with e Python 8 n Masterclass of Python Introducing Python Create with Python zi Discover theUsebasicsPython with Pi a 26 Make web apps 80 Tic-tac-toe with Kivy 104 Using Python on Pi Master this starter project Program a simple game Optimise your code g 86 Make a Pong clone 110 Send an SMS Enhance your Twilio and a game skills Combine Raspberry Pi 114 Voice synthesizer Use the eSpeak library 32 Build an app for Android 116 Program a quadcopter Take your apps on the move llm Make a drone with Pi 88 Program a Space 40 50 Python tips 122 Code a Twitter bot Invaders clone A selection of handy tips Retweet automatically Have fun with Pivaders .a 124 Control an LED 98 Make a visual novel Work with Python Use GPIO for lights Tell a story using Python 50 Replace your shell w Say goodbye to Bash 58 Scientific computing w Discover NumPy’s power 64 Python for system admins How to tweak your settings w 72 Scrape Wikipedia Start using Beautiful Soup 7 Always wanted to have a go at programming? No more excuses, because Python is the perfect way to get started! rg o s. e n zi a Python is a great programming language for both beginners and experts. It is designed with code readability g in mind, making it an excellent choice for beginners who are still getting used to various programming concepts. The language is popular and a has plenty of libraries available, allowing programmers to get a lot done with relatively little code. You can make all kinds of applications in Python: you could use the Pygame framework to write 2D games, you could use the GTK libraries to create a windowed or you could try something llmsimpleapplication, a little more ambitious like an app such as creating one using Python’s Bluetooth and Input libraries to capture the input from a USB keyboard and relay the input events to an Android phone. .a For this tutorial we’re going to be using Python 2.x since that is the version that is most likely to be installed on your Linux distribution. tutorials, you’ll learn how to create popular games using In the following w Python programming. We’ll also show you how to add sound and AI to these games. w w 8 Get started with Python g a llm .a w w rg o s. e n zi a w 9 Getting started Hello World rg o s. e n zi a Let’s get stuck in, and what better way than with the programmer’s best friend, the ‘Hello World’ application! Start by opening a terminal. Its current working directory will be your home directory. It’s probably a good idea to make a directory for the iles that we’ll be creating in this tutorial, rather than having them loose in your home directory. You can create a directory called Python using the command mkdir Python. You’ll then want to change into that directory using the command cd Python. The next step is to create an empty ile using the command ‘touch’ followed by the ilename. Our expert used the command touch hello_world.py. The inal and most important part of setting up the ile is making it executable. This allows us to run code inside the hello_ world.py ile. We do this with the command chmod +x hello_world. py. Now that we have our ile set up, we can go ahead and open it up in nano, or alternatively any text editor of your choice. Gedit is a great editor with syntax highlighting support that should be available on any distribution. You’ll be able to install it using your package manager if you don’t have it already. g a llm .a w w [

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.