Wing IDE Quick Start Guide
This is a minimalist guide for getting started quickly with Wing IDE. For a more in-depth introduction, try the Tutorial.
Install Python and Wing IDE
Start Wing IDE
Wing can be started from a menu, desktop, or tray icon or using the command line executable. For detailed instructions, see Running the IDE.
If you don't have a license, you can obtain a 30-day trial the first time you start Wing.
Set up a Project
After Wing is running, create a new project from the Project menu. Then configure your project with the following steps:
- Use Add Existing Directory in the Project menu to your sources to the project. It's best to constrain this to the directories you are actively working with and let Wing find the libraries you use through the PYTHONPATH.
- Use Project Properties in the Project menu to set Python Executable to the python.exe or other interpreter executable you want to use with your project. This is typically the full path that is in sys.executable in the desired Python installation.
- If your code alters sys.path or loads modules in a non-standard way then you may need to set Python Path so that Wing can find your modules for auto-completion, refactoring, debugging, testing, other features.
- You may want to right-click on your main entry point in the Project tool and select Set As Main Debug File so that debugging always starts there.
- Use Save Project As in the Project menu to save your project to disk.
Note: Wing may consume significant CPU time when it first analyzes your code base. Progress is indicated in the lower left of the IDE window. Once this is done, the results are cached across sessions and Wing should run with a snappy and responsive interface.
Configuring the UI
You are now ready to start working with code, but may want to make a few configuration changes first:
Key Bindings - Wing can emulate VI/Vim, Visual Studio, Emacs, Eclipse, and Brief editors, selected with the User Interface > Keyboard > Personality preference.
Tab Key - The default tab key action depends on file type, context, and whether or not there is a selection. This can be changed from the User Interface > Keyboard > Tab Key Action preference.
There are many other options in Preferences.
Wing provides many ways to get around your code quickly:
Goto-definition is available from the toolbar, Source menu, and by right-clicking on symbols in the editor or shells. Use the browser-like forward/back history buttons at the top left of the editor to return from visiting a point of definition.
Source Index menus at the top of the editor provide quick access to other parts of a source file.
Find Symbol in the Source menu jumps to a symbol defined in the current file by typing a fragment of its name.
Find Symbol in Project works the same way but searches all files in the project.
Open From Project in the File menu is a similar interface for quickly opening project files.
Find Points of Use when you right-click on a symbol shows where that symbol is being used. Wing distinguishes between separate but like-named symbols.
Source Browser provides module or class oriented display of the structure of your code. Show both the Source Browser and Source Assistant for detailed information about selected symbols.
Mini-search is a powerful keyboard-driven search and replace facility. The key bindings listed in the Mini-search area of the Edit menu will display the search entry area at the bottom of the screen.
Search in the Tools menu provides incremental text, wildcard, and regular expression search and replace in selections and the current file.
Search in Files in the Tools menu provides wildcard and regular expression search and replace in filtered sets of files, directories, named file sets, and within the project.
Toolbar search is another quick way to search the current file.
Wing's editor focuses on fast error-free Python coding:
Auto-completion in Wing's editor speeds up typing and reduces coding errors. The auto-completer uses Tab by default for completion, but this can be changed in the Editor > Auto-Completion > Completion Keys preference.
Call Tips and Documentation shown in the Source Assistant update as you move through your code or work in the shells.
Auto-indent while typing matches the file's existing indentation. When multiple lines are pasted, they are re-indented according to context (a single Undo reverts any unwanted indentation change). Wing also provides an Indentation tool for converting a file's indentation style.
Auto-Editing implements a range of operations such as auto-entering closing parentheses, brackets, braces, and quotes. Among other things, Wing also auto-enters invocation arguments, manages new blocks with the : key, and corrects out-of-order typing.
Auto-editing operations can be enabled and disabled in the Editor > Auto-Editing preferences group. The default set includes those operations that don't affect finger memory. The others are well worth learning.
For details, see Auto-Editing.
Refactoring in Wing supports automated renaming and moving of symbols, extracting functions or methods, and introducing variables more quickly than by manually editing code.
Snippets are included in Wing's auto-completer as a quick way to enter commonly repeated coding motifs for coding standards, documentation, testing, and so forth. Data entry for snippet arguments is inline in the editor. Use the Tab key to move between the fields. Edit or add snippets in the Snippets tool.
Turbo Completion is an optional auto-completion mode made possible by Wing's powerful source analysis engine. When the Editor > Auto-Editing > Python Turbo Mode preference is enabled, Wing turns every non-symbol key into a completion key in contexts where a new symbol name is not being typed. The modifier keys can be used alone to escape from the completer in the rare cases when Wing fails to provide the desired completion.
Code Selection from the Edit > Select menu makes selecting whole statements, blocks, or scopes a snap, before copying, editing, or searching through them.
Wing's debugger is a powerful tool for finding and fixing bugs, understanding unfamiliar code, and writing new code interactively.
Breakpoints can be set by clicking on the breakpoint margin of the editor and debugging is started from the toolbar or Debug menu. The Stack Data tool is used to inspect or change program data. Debug process I/O is shown in the Debug I/O tool, or optionally in an external console.
Interactive Debugging is supported by the Debug Probe, which provides an interactive Python prompt that executes code in the current debug stack frame. When the debugger is paused Wing alos uses the live runtime state to fuel the auto-completer in the editor, Source Assistant, goto-definition, and other tools.
Conditional Breakpoints can be used to isolate and understand complex bugs by stopping before they occur. Using a conditional breakpoint to isolate a broken case and the Debug Probe to design a fix is far more accurate and productive than relaunching code repeatedly.
Move Program Counter is also supported in the innermost stack frame by right clicking in the editor and selecting Move Program Counter Here.
Watching Values by right-clicking on the editor or any of the data views tracks values over time by symbolic name or object reference in the Watch tool. Expressions can be also be watched.
Launch Configurations in the Project menu can be used with Named Entry Points in the Debug menu define different runtime environments for debugging, executing, and unit testing your code.
Wing contains many other features, including:
Python Shell -- Wing's Python Shell lets you try out code in a sandbox process kept isolated from Wing IDE and your debug process. The shell provides auto-completion, goto-definition, and is integrated with the Source Assistant.
Unit Testing in Wing's Testing tool works with unittest, doctest, pytest, nose, and Django unit tests. You can run tests suites, view the results, and debug tests.
Version Control in Wing supports Mercurial, Git, Subversion, Perforce, Bazaar, and CVS version control systems. Wing should auto-detect which systems are used in your project and show the appropriate additional menubar menus and tools in the Tools menu. Right-click on the editor, Project tool, or items in the version control tool to compare that file or directory to the repository with Compare to Repository. Wing will display both versions with differences highlighted and the added toolbar tools can be used to move through and merge differences. This capability is also available for comparing two files or directories, and a modified buffer to its disk file, by clicking on the Difference/Merge icon in the toolbar.
Running Command Lines in Wing's OS Commands tool makes it possible to set up and easily execute external tools. This can also be used to set up a build command that will be executed automatically before each debug sessions.
User Interface Customization in Preferences gives you control of the overall layout and color of the IDE, among many other options. Right click on the tabs for layout options, or drag tool and editor tabs to move them or create new splits. Right click on the toolbar to configure which tools are visible or to add your own. Wing also supports defining sharable color palettes and syntax colors.
Perspectives in Wing Pro let you save named tool panel configurations.
Many Other Features such as bookmarks, line editing, code folding, macros are also available. You can also extend Wing IDE by writing Python scripts.
For more information see: