Skip to main content
Top

Advanced Guide to Python 3 Programming

  • 2019
  • Book

About this book

Advanced Guide to Python 3 Programming delves deeply into a host of subjects that you need to understand if you are to develop sophisticated real-world programs. Each topic is preceded by an introduction followed by more advanced topics, along with numerous examples, that take you to an advanced level.

There are nine different sections within the book covering Computer Graphics
(including GUIs), Games, Testing, File Input and Output, Databases Access, Logging, Concurrency and Parallelism, Reactive programming, and Networking. Each section is self-contained and can either be read on its own or as part of the book as a whole.

This book is aimed at the those who have learnt the basics of the Python 3 language
but want to delve deeper into Python’s eco system of additional libraries and modules,
to explore concurrency and parallelism, to create impressive looking graphical interfaces, to work with databases and files and to provide professional logging facilities.

Table of Contents

Next
  • current Page 1
  • 2
  • 3
  1. Frontmatter

  2. 1. Introduction

    John Hunt
    Abstract
    I have heard many people over the years say that Python is an easy language to lean and that Python is also a simple language. To some extent both of these statements are true; but only to some extent. However, once you have learned the core elements of the language such as how classes and inheritance work, how functions work, what are protocols and Abstract Base Classes etc. Where do you go next? The aim of this book is to delve into those next steps.
  3. Computer Graphics

    1. Frontmatter

    2. 2. Introduction to Computer Graphics

      John Hunt
      Abstract
      Computer Graphics are everywhere; they are on your TV, in cinema adverts, the core of many films, on your tablet or mobile phone and certainly on your PC or Mac as well as on the dashboard of your car, on your smart watch and in childrens electronic toys. This chapter introduces this topic.
    3. 3. Python Turtle Graphics

      John Hunt
      Abstract
      Python is very well supported in terms of graphics libraries. One of the most widely used graphics libraries is the Turtle Graphics library introduced in this chapter. This is partly because it is straight forward to use and partly because it is provided by default with the Python environment (and thus you do not need to install any additional libraries to use it).
    4. 4. Creating Computer Art

      John Hunt
      Abstract
      Computer Art is defined as any art that uses a computer. However, in the context of this book we mean it to be art that is generated by a computer or more specifically a computer program. The following example, illustrates how in a very few lines of Python code, using the Turtle graphics library, you can create images that might be considered to be computer art.
    5. 5. Introduction to Matplotlib

      John Hunt
      Abstract
      Matplotlib is a Python graphing and plotting library that can generate a variety of different types of graph or chart in a variety of different formats. It can be used to generate line charts, scatter graphs, heat maps, bar charts, pie charts and 3D plots. It can even support animations and interactive displays. In this chapter we will introduce the Matplotlib library, its architecture, the components that comprise a chart and the pyplot API.
    6. 6. Graphing with Matplotlib pyplot

      John Hunt
      Abstract
      In this chapter we will explore the Matplotlib pyplot API. This is the most common way in which developers generate different types of graphs or plots using Matplotlib.
    7. 7. Graphical User Interfaces

      John Hunt
      Abstract
      A Graphical User Interface can capture the essence of an idea or a situation, often avoiding the need for a long passage of text. Such interfaces can save a user from the need to learn complex commands. They are less likely to intimidate computer users and can provide a large amount of information quickly in a form which can be easily assimilated by the user. This chapter we will first introduce what we mean by a GUI and by WIMP based UIs in particular. We will then consider the range of libraries available for Python before selecting wxPython.
    8. 8. The wxPython GUI Library

      John Hunt
      Abstract
      The wxPython library is a cross platform GUI library (or toolkit) for Python. It allows programmers to develop highly graphical user interfaces for their programs using common concepts such as menu bars, menus, buttons, fields, panels and frames. This chapter provides an overview of the wxPython GUI library.
    9. 9. Events in wxPython User Interfaces

      John Hunt
      Abstract
      Events are an integral part of any GUI; they represent user interactions with the interface such as clicking on a button, entering text into a field, selecting a menu option etc. This chapter introduces event handling in wxPython.
    10. 10. PyDraw wxPython Example Application

      John Hunt
      Abstract
      This chapter builds on the GUI library presented in the last two chapters to illustrate how a larger application can be built. It presents a case study of a drawing tool akin to a tool such as Visio etc.
  4. Computer Games

    1. Frontmatter

    2. 11. Introduction to Games Programming

      John Hunt
      Abstract
      Games programming is performed by developers/coders who implement the logic that drives a game. This chapter introduces Games programming.
    3. 12. Building Games with pygame

      John Hunt
      Abstract
      pygame is a cross-platform, free and Open Source Python library designed to make building multimedia applications such as games easy. This chapter introduces pygame, the key concepts; the key modules, classes and functions and a very simple first pygame application.
    4. 13. StarshipMeteors pygame

      John Hunt
      Abstract
      In this chapter we will create a game in which you pilot a starship through a field of meteors. The longer you play the game the larger the number of meteors you will encounter. We will implement several classes to represent the entities within the game.
  5. Testing

    1. Frontmatter

    2. 14. Introduction to Testing

      John Hunt
      Abstract
      This chapter considers the different types of tests that you might want to perform with the systems you develop in Python. It also introduces Test Driven Development
    3. 15. PyTest Testing Framework

      John Hunt
      Abstract
      There are several testing frameworks available for Python, although only one, unittest comes as part of the typical Python installation. Typical libraries include unittest (which is available within the Python distribution by default) and PyTest. This chapter introduces the PyTest testing framework.
    4. 16. Mocking for Testing

      John Hunt
      Abstract
      Testing software systems is not an easy thing to do; the functions, objects, methods etc. That are involved in any program can be complex things in their own right. In many cases they depend on and interact with other functions, methods and objects; very few functions and methods operate in isolation. Thus the success of failure of a function or method or the overall state of an object is dependent on other program elements.
Next
  • current Page 1
  • 2
  • 3
Title
Advanced Guide to Python 3 Programming
Author
Dr. John Hunt
Copyright Year
2019
Electronic ISBN
978-3-030-25943-3
Print ISBN
978-3-030-25942-6
DOI
https://doi.org/10.1007/978-3-030-25943-3

Accessibility information for this book is coming soon. We're working to make it available as quickly as possible. Thank you for your patience.

Premium Partner

    Image Credits
    Neuer Inhalt/© ITandMEDIA, Nagarro GmbH/© Nagarro GmbH, AvePoint Deutschland GmbH/© AvePoint Deutschland GmbH, AFB Gemeinnützige GmbH/© AFB Gemeinnützige GmbH, USU GmbH/© USU GmbH, Ferrari electronic AG/© Ferrari electronic AG