Learn Programming in Python with Cody Jackson

Book description

Kick-start your development journey with this end-to-end guide that covers Python programming fundamentals along with application development

Key Features

  • Gain a solid understanding of Python programming with coverage of data structures and Object-Oriented Programming (OOP)
  • Design graphical user interfaces for desktops with libraries such as Kivy and Tkinter
  • Write elegant, reusable, and efficient code

Book Description

Python is a cross-platform language used by organizations such as Google and NASA. It lets you work quickly and efficiently, allowing you to concentrate on your work rather than the language. Based on his personal experiences when learning to program, Learn Programming in Python with Cody Jackson provides a hands-on introduction to computer programming utilizing one of the most readable programming languages?Python. It aims to educate readers regarding software development as well as help experienced developers become familiar with the Python language, utilizing real-world lessons to help readers understand programming concepts quickly and easily.

The book starts with the basics of programming, and describes Python syntax while developing the skills to make complete programs. In the first part of the book, readers will be going through all the concepts with short and easy-to-understand code samples that will prepare them for the comprehensive application built in parts 2 and 3. The second part of the book will explore topics such as application requirements, building the application, testing, and documentation. It is here that you will get a solid understanding of building an end-to-end application in Python. The next part will show you how to complete your applications by converting text-based simulation into an interactive, graphical user interface, using a desktop GUI framework. After reading the book, you will be confident in developing a complete application in Python, from program design to documentation to deployment.

What you will learn

  • Use the interactive shell for prototyping and code execution, including variable assignment
  • Deal with program errors by learning when to manually throw exceptions
  • Employ exceptions for code management
  • Enhance code by utilizing Python's built-in shortcuts to improve efficiency and make coding easier
  • Interact with files and package Python data for network transfer or storage
  • Understand how tests drive code writing, and vice versa
  • Explore the different frameworks that are available for GUI development

Who this book is for

Learn Programming in Python with Cody Jackson is for beginners or novice programmers who have no programming background and wish to take their first step in software development. This book will also be beneficial for intermediate programmers and will provide deeper insights into effective coding practices in Python.

Publisher resources

Download Example Code

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Learn Programming in Python with Cody Jackson
  3. About Packt
    1. Why subscribe?
    2. Packt.com
  4. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. The Fundamentals of Python
    1. What is Python?
      1. Python versions
      2. Interpreted versus compiled
      3. Dynamic versus static
        1. Python 2 versus Python 3 division
    2. Working with Python
      1. Installation
      2. Launching the Python interpreter
        1. Windows (Win8 and above)
        2. Mac
      3. Using the Python command prompt
    3. Commenting Python code
    4. Launching Python programs
    5. Using the IPython shell
    6. Summary
  7. Data Types and Modules
    1. Structuring code
      1. Multiple line spanning
    2. Common data types
    3. Python numbers
    4. Strings
      1. Basic string operations
      2. Indexing and slicing strings
      3. String formatting
      4. Combining and separating strings
    5. Lists
      1. List usage
      2. Adding list elements
      3. Mutability
    6. Dictionaries
      1. Creating dictionaries
      2. Working with dictionaries
      3. Dictionary details
    7. Tuples
      1. Why use tuples?
      2. Sequence unpacking
    8. Sets
    9. Using data type methods
      1. Sequence methods
      2. String methods
      3. List methods
      4. Tuple methods
      5. Dictionary methods
      6. Set methods
    10. Importing modules
      1. Namespaces
      2. Dot nomenclature
      3. Types of imports
      4. Modules as scripts
    11. Summary
  8. Logic Control
    1. if...else statements
    2. Loops
      1. while loops
      2. for loops
      3. zip() function
    3. Exceptions
      1. Exception class hierarchy
      2. User-defined exceptions
      3. Final thoughts
    4. Summary
  9. Functions and Object Oriented Programming
    1. Working with functions
      1. Lambdas
    2. Classes, methods, and namespaces
      1. How are classes better?
      2. Classes and instances
      3. Modules
      4. Inheritance
      5. Operator overloading
    3. Properties and class and static methods
      1. Properties
        1. Getters and setters
      2. Class and static methods
    4. Summary
  10. Files and Databases
    1. File I/O
      1. Files and streams
      2. Reading from a file
      3. Iterating through files
      4. Seeking
      5. Serialization
    2. Python and SQLite
      1. Working with databases
      2. Using SQL to query a database
      3. Creating a SQLite database
      4. Retrieving data from a database
      5. SQLite database files
    3. SQLAlchemy
      1. Writing a SQLAlchemy database
      2. Filling and querying the database
    4. Summary
  11. Application Planning
    1. Software development life cycle
    2. Development practices and methodologies
      1. Incremental development
      2. Continuous integration
      3. Prototyping
      4. Rapid application development
      5. Waterfall development
      6. Spiral development
      7. Agile development
    3. Project requirements
    4. Software repositories
    5. Summary
  12. Writing the Imported Program
    1. Project requirements
    2. Utility functions
    3. Simulating storage tanks
      1. Name mangling
    4. Simulating valves
      1. Base valve class
      2. Gate valve class
      3. Globe valve class
      4. Relief valve class
    5. Simulation pumps
      1. Base pump class
      2. Centrifugal pump class
      3. Positive displacement pump class
    6. Summary
  13. Automated Software Testing
    1. Testing techniques
      1. Static versus dynamic tests
      2. White-box testing
      3. Black-box testing
      4. When to test
    2. Writing tests
    3. Refactoring code
    4. Summary
  14. Writing the Fueling Scenario
    1. Fueling scenario requirements
    2. Directory structure
    3. Component coding
    4. Functionality coding
    5. Testing
    6. Summary
  15. Software Post-Production
    1. Docstrings
    2. Sphinx documentation
    3. Lessons learned
    4. Summary
  16. Graphical User Interface Planning
    1. GUI functionality
      1. GUI elements
      2. Best practices
    2. User environment
    3. Graphical frameworks
    4. Summary
  17. Creating a Graphical User Interface
    1. Wireframing
    2. Coding the interface
      1. Kivy logic file
      2. Kivy layout file
    3. GUI testing
    4. Summary
  18. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Learn Programming in Python with Cody Jackson
  • Author(s): Cody Jackson
  • Release date: November 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789531947