Summary
In this chapter, we touched upon some introductory concepts in Python to develop a simple command-line application. We first equipped ourselves by setting up a Python development environment.
The first program we wrote was a simple Python script. We soon realized that a simple script would be hard to maintain if more features are added. As a next step, we did a bit of refactoring and wrapped the code inside functions. This improved the code readability and also made it easier to manage. The proposed introduction of more features to the application made us rethink the design. We learned how to transform the code into an object-oriented design and implemented a few of these new features.
And how can we forget Sir Foo! He will accompany us throughout this book.
Is the code developed free from bugs? You might have already noticed some problems while playing the game! In the next chapter, we will see how to make the application more robust by handling exceptions.
Very important note for e-book readers
The code illustrations that you see in this book are actually image files or code snapshots.
The rendering quality of these images will vary depending on your PDF reader's page display resolution and the zoom level.
If you have trouble clearly reading this code, you may try the following in your PDF or e-book reader:
- Set the zoom level to 100%
- Use the page display resolution of 96 pixels/inch or similar
If the problem still persists, you can try with a different resolution.
How do you set this resolution? It will depend on your e-book reader. For example, if you are using Adobe Reader, go to Edit | Preferences and then select Page Display from the left panel. You will see Resolution as an option in the right panel. Select 96 pixels/inch or similar and see if that helps render the images better.