Python For Kids For Dummies. Scott Brendan
Чтение книги онлайн.
Читать онлайн книгу Python For Kids For Dummies - Scott Brendan страница 3
Some of the things that make Python totes awesome (also known as “really helpful and lots of fun”) are:
✓ Python code is easy to read and understand. In fact, I think Python’s code is sublime and beautiful. (Hey, that’s just my opinion.) Its beauty means you don’t even notice the way Python makes complex things simple. This makes Python easy to learn, which makes it perfect for kids.
✓ Python is productive. It makes tough tasks simple. Almost any programming task is easier with Python than it is with other programming languages. Computer types call this RAD (for Rapid Application Development).
✓ Python is dangerous. It has a lot of power. But with great power comes great responsibility. (Remember Spider-Man?) And you’ll have to use your powers for good, not evil. (If you want to use them for evil, you have to stop reading now.)
✓ Python is a scripting language. The programs are fed into Python’s interpreter, which runs them directly, so there’s no compiling (which is the case for some other languages). It is faster and easier to get feedback on your Python code (finding errors, for example). Python means you complete and execute (run) your programs faster and that makes programming fun!
✓ Python is cross platform. Almost anyone can use it, no matter what computer operating system they have. You can run pretty much any Python program on Windows, Mac, and Linux personal computers and from large servers through to tiny computers like the Raspberry Pi. (A Pi-specific project is waiting at dummies.com/go/pythonforkids for you.) You can even run Python programs on Android and iOS tablets. I even used my Android tablet to code some of the early projects in this book.
✓ Python uses dynamic typing for its variables. This may not mean much to you if you’ve never done programming before. Dynamically typed variables make programming easier because they let you just start using a variable, rather than first explaining to the computer what the variable is supposed to be.
✓ Python gets lots of help from third-party modules. This means that a lot of other people (third parties) have written libraries. A library is a bunch of code for doing something specific. This makes your work easier because you don’t have to start from scratch every time you write a new program; sometimes you can use the libraries already written. The Minecraft project online uses a third-party library to change a Minecraft game on a Raspberry Pi.
✓ Python is free software. This means that the license terms for Python respect your freedom. I think this is pretty important. You can download and run Python without paying any money, and any program that you write with it is yours to use and share any way you want. It also means that the Python source code (the human-readable form of what the computer runs) is available so, when you’re feeling brave enough, you can look at how the Python developers wrote their code. (It’s written in a different programming language, though, d’oh!)
The Python programming language is named after a comedy group called Monty Python, not the reptile. Monty Python was active mainly in the 1970s. (40 years ago! Forever and ever, right?) They had a British television show called Monty Python’s Flying Circus and have made lots of movies, the most notable of which is Monty Python and the Holy Grail.
Python is used just about everywhere.
✓ In space: The International Space Station’s Robonaut 2 robot uses Python for its central command system. Python is planned for use in a European mission to Mars in 2020 to collect soil samples.
✓ In particle physics laboratories: Python helps understand the data analysis from some atom smashing experiments at the CERN Large Hadron Collider.
✓ In astronomy: The MeerKat Radio telescope array (the largest radio telescope in the Southern Hemisphere) uses Python for its control and monitoring systems.
✓ In movie studios: Industrial Light and Magic (Star Wars geniuses) uses Python to automate its movie production processes. Side Effects Software’s computer-generated imagery program Houdini uses Python for its programming interface and to script the engine.
✓ In games: Activision uses Python for building games, testing, and analyzing stuff. They even use Python to find people cheating by boosting each other.
✓ In the music industry: Spotify music streaming service uses Python to send you music.
✓ In the video industry: Netflix uses Python to make sure movies play (stream) without stopping. Python is used a lot for YouTube.
✓ In Internet search: Google used Python all over in its early development phase.
✓ In medicine: The Nodality company uses Python to handle information that they use to search for a cure to cancer.
✓ In your OS (admin-ing your datas): Operating systems like Linux and Mac OSX use Python for some of their administrative functions.
✓ In your doorbell: Rupa Dachere and Akkana Peck say that you can automate your home with Python, hooking up sensors to your house. With it you can, for example, open and close the curtains or automatically turn on lights when you come in the room.
I could go on. The point is that Python will apply to whatever you’re interested in, no matter what it is.
You do these things while you work through this book:
✓ Make a math trainer for practicing your times tables.
✓ Make a simple encryption (a secret code) program.
✓ Use Python on a Raspberry Pi to work with and modify your Minecraft world. (See www.dummies.com/go/pythonforkids for that project.)
When you’ve honed your mad skills and are ready to move on, there’ll be other things you can do:
✓ Using Tkinter (or other widget sets), you can write user applications that use graphics rather than just text to interact with the user.
✓ You can extend other programs like Blender (a 3D modeling program), GIMP (a 2D photo-retouching program), and LibreOffice (office programs), among many others by writing custom scripts. I had to fix some 3D models I was making in Blender. It would’ve taken forever to do by hand, so I wrote a Python script to do it quickly.
✓ You can write games with graphics using Tkinter or the Pygame or Kivy libraries. The games in this book are text only.
✓ You can use the matplotlib library to draw complex graphs for your math or science courses.
✓ Using the openCV library, you can experiment with computer vision. People who are into robotics use it to help their robots see and grab things and to avoid obstacles when moving.
Whatever