Using Wing with pygame

Index of All Documentation » How-Tos » How-Tos for Educational Tools »


Wing Pro Screenshot

Wing is a Python IDE that can be used to develop, test, and debug Python code written for pygame, an open source framework for game development with Python.

Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional developers, and Wing Personal is a free alternative with reduced feature set.

If you do not already have Wing installed, download it now.

This document describes how to configure Wing for pygame. To get started using Wing as your Python IDE, please refer to the tutorial in Wing's Help menu or read the Quickstart Guide.

Project Configuration

Pygame works just fine with Wing without any special configuration. You'll need to first install pygame according to the instructions on the pygame website.

To create a new project, use New Project in Wing's Project menu. Select the project type ``Pygame. If your default Python does not have Pygame installed into it, you will need to choose the Python Executable to use with Pygame. This is either set to set to Activated Env to enter the command that activates a virtualenv or Anaconda environment, or Command Line to enter the full path of python.exe or python. You can determine the correct value to use by executing the following in Python:

import sys
print(sys.executable)

Press OK and then add the directory with your source code to the new project with Add Existing Directory in the Project menu.

Next find your main entry point, open it into Wing, and select Set Current as Main Entry Point in the Debug menu.

Debugging

Now you can launch your game from Wing with Start/Continue in the Debug menu. Wing will stop on any exceptions or breakpoints reached while running your game, and you can use the debugger to step through code, inspect the value of variables, and try out new code interactively.

/images/doc/en/howtos/pygame/fishtank.png

To learn more about Wing's features, please refer to the tutorial in Wing's Help menu or read the Quickstart Guide.

Related Documents

Wing provides many other options and tools. For more information: