Книга: Automate the Boring Stuff with Python: Practical Programming for Total Beginners
Назад: Acknowledgments
Дальше: I. Python Programming Basics

, and there are versions for Linux, OS X, and Windows.

The name Python comes from the surreal British comedy group Monty Python, not from the snake. Python programmers are affectionately called Pythonistas, and both Monty Python and serpentine references usually pepper Python tutorials and documentation.

, it cannot appear elsewhere in the top row, in the leftmost column, or in the top-left 3×3 square. Solving one row, column, or square at a time will provide more number clues for the rest of the puzzle.

  • . Covers expressions, the most basic type of Python instruction, and how to use the Python interactive shell software to experiment with code.

  • . Explains how to make programs decide which instructions to execute so your code can intelligently respond to different conditions.

  • . Instructs you on how to define your own functions so that you can organize your code into more manageable chunks.

  • . Introduces the list data type and explains how to organize data.

  • . Introduces the dictionary data type and shows you more powerful ways to organize data.

  • . Covers working with text data (called strings in Python).

  • . Covers how Python can manipulate strings and search for text patterns with regular expressions.

  • . Explains how your programs can read the contents of text files and save information to files on your hard drive.

  • . Shows how Python can copy, move, rename, and delete large numbers of files much faster than a human user can. It also explains compressing and decompressing files.

  • . . Shows how to write programs that can automatically download web pages and parse them for information. This is called web scraping.

  • . Covers programmatically manipulating Excel spreadsheets so that you don’t have to read them. This is helpful when the number of documents you have to analyze is in the hundreds or thousands.

  • . Covers programmatically reading Word and PDF documents.

  • . Continues to explain how to programmatically manipulate documents with CSV and JSON files.

  • . Explains how time and dates are handled by Python programs and how to schedule your computer to perform tasks at certain times. This chapter also shows how your Python programs can launch non-Python programs.

  • . Explains how to write programs that can send emails and text messages on your behalf.

  • . Explains how to programmatically manipulate images such as JPEG or PNG files.

  • . Explains how to programmatically control the mouse and keyboard to automate clicks and keypresses.

. If you download the latest version from the website’s download page, all of the programs in this book should work.

.

) or the “learn programming” subreddit at . But keep in mind there are smart ways to ask programming questions that help others help you. Be sure to read the Frequently Asked Questions sections these websites have about the proper way to post questions.

When asking programming questions, remember to do the following:

  • Explain what you are trying to do, not just what you did. This lets your helper know if you are on the wrong track.

  • Specify the point at which the error happens. Does it occur at the very start of the program or only after you do a certain action?

  • Copy and paste the entire error message and your code to or .

    These websites make it easy to share large amounts of code with people over the Web, without the risk of losing any text formatting. You can then put the URL of the posted code in your email or forum post. For example, here some pieces of code I’ve posted: and .

  • Explain what you’ve already tried to do to solve your problem. This tells people you’ve already put in some work to figure things out on your own.

  • List the version of Python you’re using. (There are some key differences between version 2 Python interpreters and version 3 Python interpreters.) Also, say which operating system and version you’re running.

  • If the error came up after you made a change to your code, explain exactly what you changed.

  • Say whether you’re able to reproduce the error every time you run the program or whether it happens only after you perform certain actions. Explain what those actions are, if so.

Always follow good online etiquette as well. For example, don’t post your questions in all caps or make unreasonable demands of the people trying to help you.

, and you can contact me with questions at .

This book will start you off from zero programming knowledge, but you may have questions beyond its scope. Remember that asking effective questions and knowing how to find answers are invaluable tools on your programming journey.

Let’s begin!

Назад: Acknowledgments
Дальше: I. Python Programming Basics

© RuTLib.com 2015-2018