Automate the Boring Stuff with Python Quotes

3,103 ratings, 4.28 average rating, 270 reviews
Automate the Boring Stuff with Python Quotes
Showing 1-10 of 10
“To paraphrase an old joke among programmers, “Writing code accounts for 90 percent of programming. Debugging code accounts for the other 90 percent.” Your computer will do only what you tell it to do; it won’t read your mind and do what you intended it to do. Even professional programmers create bugs all the time, so don’t feel discouraged if your program has a problem.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“>>> robocop.search('Al, why does your programming book talk about robocop so much?').group()
'robocop”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
'robocop”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“A value being passed to a function in a function call is an argument. The argument 'Al' is assigned to a local variable named name. Variables that have arguments assigned to them are parameters.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“The most common anxiety I hear about learning to program is that people think it requires a lot of math. Actually, most programming doesn’t require math beyond basic arithmetic. In fact, being good at programming isn’t that different from being good at solving Sudoku puzzles. To solve a Sudoku puzzle, the numbers 1 through 9 must be filled in for each row, each column, and each 3×3 interior square of the full 9×9 board. You find a solution by applying deduction and logic from the starting numbers. For”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“To avoid concurrency issues, never let multiple threads read or write the same variables. When you create a new Thread object, make sure its target function uses only local variables in that function. This will avoid hard-to-debug concurrency issues in your programs.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“You can easily create several new threads and have them all running at the same time. But multiple threads can also cause problems called concurrency issues. These issues happen when threads read and write variables at the same time, causing the threads to trip over each other. Concurrency issues can be hard to reproduce consistently, making them hard to debug.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“A single-threaded program has only one finger. But a multithreaded program has multiple fingers. Each finger still moves to the next line of code as defined by the flow control statements, but the fingers can be at different places in the program, executing different lines of code at the same time.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“In plain English, an assert statement says, “I assert that this condition holds true, and if not, there is a bug somewhere in the program.” Unlike exceptions, your code should not handle assert statements with try and except; if an assert fails, your program should crash. By failing fast like this, you shorten the time between the original cause of the bug and when you first notice the bug. This will reduce the amount of code you will have to check before finding the code that’s causing the bug. Assertions are for programmer errors, not user errors. For errors that can be recovered from (such as a file not being found or the user entering invalid data), raise an exception instead of detecting it with an assert statement.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“An assertion is a sanity check to make sure your code isn’t doing something obviously wrong. These sanity checks are performed by assert statements. If the sanity check fails, then an AssertionError exception is raised.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
“For example, instead of crashing your program right when an exception occurs, you can write the traceback information to a log file and keep your program running. You can look at the log file later, when you’re ready to debug your program.”
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners
― Automate the Boring Stuff with Python: Practical Programming for Total Beginners