About Project Configuration

Index of All Documentation » Wing Pro Reference Manual » Project Manager » Creating a Project »


Wing uses projects as a way to configure the environment needed by your code, and to distinguish between source files that are part of your code base (those you are likely to want to open, edit, search, etc.) and those that are just in libraries or packages that you use (and should be discovered by Wing's code intelligence features).

Once a project has been set up from the New Projects dialog, the project's configuration can be viewed and modified from Project Properties in the Project menu. The configuration is described in more detail in Project Properties.

To see or change which files are in your project, use the Project tool in the Tools menu, as described below.

Python Environment

Whether you do it from the New Project dialog or later in Project Properties, it is important to set up the Python environment that Wing should be using with your code. This affects the contents of the auto-completer, the display of code warnings and errors, and many other features that need to distinguish between syntactic and other differences across Python versions. It also allows Wing to find and analyze all the third party packages that you may use in your code.

In addition to setting Python Executable, you may also need to set Python Path or Environment in Project Properties so Wing can successfully find and inspect all the modules that your code uses. Setting Python Path is usually only necessary if your code modifies sys.path at runtime. Setting Environment is (relatively rarely) needed to allow Python modules to load and use DLLs.

Adding Files and Directories

Adding your source files to the project tells Wing which files you are working on, which is important for searching, Open From Project, and other features. Usually only the source base you are working on should be added to the project, while Python's standard libraries and other frameworks and libraries used by your code can be left out of the project and instead found, as needed, through the Python Path. Packages that are installed into Python will be found automatically.

If you did not add all your source code from the New Project dialog, you can do so with Add Existing Directory in the Project menu. This allows you to control which files to include, and whether or not sub-directories are included. The list of files shown in the project updates as files matching the criteria are added and removed on disk.

Individual files can be added with Add Current File and Add Existing File.

Add New File can be used to create a new file and simultaneously add it to your project.

A subset of these options can be accessed from the context menu that appears when right-clicking on the Project tool.

Removing or Omitting Files and Directories

To remove a specific file or directory, select it and use Remove Selected Entry in the Project menu or Remove/Exclude From Project in the right-click context menu on the Project tool.

If the removed file or directory is part of another directory that has been added to the project, the removal is remembered as an exclusion that can be cleared from Directory Properties, which are accessed by right clicking on the parent directory in the Project tool.

Saving a New Project

The New Project dialog automatically saves your new project if you are creating a new source directory along with it. If you selected an existing source directory or created a new blank project, then your project is created as an untitled unsaved file. In this case you will need to save it with Save Project in the Project menu. Once a project file has been saved the first time, it will be re-saved automatically as you work with Wing and there is no need to save it manually again unless you wish to move the project file, as described in the next section.