This is a minimalist guide for those wanting to get started with Wing IDE as quickly as possible. For a more in-depth introduction, try the Tutorial.
Install Python and Wing IDE
Set up a Project
Wing starts up initially with a blank Default Project. To get the most out of Wing, you must set up your project as follows:
- Use Add Directory and other items in the Project menu to add source files to the project.
- Use Project Properties in the Project menu to specify Python Path and in some cases select the specific version of Python for use with your project. These two steps tell Wing how to resolve imports in your code, so it can discover and analyze your source base. This powers Wing's auto-completer, source assistant, refactoring tool, source browser, and code navigation features. It is also used debugging, executing, or testing code.
- You may also 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.
- Save your project to disk.
Note: Depending on the size of the code base you have added to your project, Wing may consume significant CPU time for up to several minutes analyzing your source code. Once this is done, Wing should run with a snappy and responsive interface even on slower machines. If not, please let us know.
You are now ready to start working with code. Most of Wing's features are readily evident from the user interface. The Wing Tips tool provides brief usage hints.
These are the features you should be sure to try while evaluating Wing IDE:
- Configurable Key Bindings -- Wing can emulate VI/Vim, Visual Studio, Emacs, Eclipse, and Brief key bindings, selected with the editor Personality preference.
- Configurable 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 Tab Key Action preference.
- Auto-completion and Source Assistant -- Wing's editor and the Source Assistant tool provide context-appropriate completion options and documentation as you edit your code. The auto-completer uses Tab by default for completion, but this can be changed in the Completion Keys preference
- Auto-indent -- Wing auto-indents new code in a way that matches the file's indentation style. When multiple lines are pasted, they are also reindented according to context. When the indentation change is unwanted, it can be undone with a single Undo. Wing also provides an Indentation tool for converting a file's indentation style.
- Goto-definition -- Available from the toolbar, Source menu, and by right-clicking on symbols in the editor. Use the browser-like forward/back history buttons at the top left of the editor to return from visiting a point of definition.
Source Navigation -- The index menus at the top of the editor provide quick access to other parts of a source file from the menus at the top of the source editor.
Also try Find Symbol from the Source menu to jump to a symbol by typing a fragment of its name.
In Wing Pro, the Source Browser is another way to navigate through your source code.
- Find Points of Use -- Right click on a symbol and select Find Points of Use to see where that symbol is being used. Wing distinguishes between independent but like-named symbols.
- Auto-Editing -- Wing implements a variety of auto-editing operations, for example auto-entering closing parentheses, brackets, braces, and quotes. Wing also auto-enters invocation arguments. You can simply type over them or use the Tab key to move between the arguments and default keyword argument values. Auto-editing operations can be enabled and disabled with Configure Auto-Editing in the Keyboard Personality sub-menu of the Edit menu. The default set includes those operations that shouldn't affect finger memory. Be sure to try Manage Blocks on Repeated Colon Presses as well, which makes new block starts to existing code a lot easier.
- Refactoring -- Wing supports automated renaming and moving of symbols, extracting functions or methods, and introducing variables quickly with its Refactoring capability.
- Mini-search -- Wing's powerful keyboard-driven search and replace facility is available from the Edit menu. Using the keyboard equivalents given in the menu, bring up the search entry area at the bottom of the screen, type in a search string, then repeat the key bindings for repeated search forward/backward.
- Search Managers -- Provide single and multi-file, wild card, and regular expression search and replace. Available as Search and Search in Files in the tools area.
- Source Browser -- The source browser provides module or class oriented display of the structure of your source code. Show both the Source Browser and Source Assistant for detailed information about selected symbols.
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.
Basic Debugging -- Set a breakpoint and start debugging. You can use the Stack Data tools to inspect or change program data. Wing distinguishes between fatal and non-fatal exceptions at the time they are raised, allowing you to inspect live program state more often. Debug process I/O is shown in the Debug I/O tool (or optionally in an external console).
Notice that when the debugger is paused Wing also uses the live runtime state to fuel the auto-completer in the editor, Source Assistant, goto-definition, and other tools.
- Debug Probe -- This tool provides an interactive Python prompt that executes code in the current stack frame of a paused debug process. The Debug Probe is particularly useful in isolating and understanding complex bugs, and designing code that fixes the problem. Try using it also to write new code in the context of the live runtime state for which it is being designed.
- Conditional breakpoints -- A powerful tool in isolating complex bugs by stopping before they occur.
- Watching Values -- Enter expressions to watch in the Watch tool, or right-click on any of the data views to track value over time by symbolic name or object reference.
- Launch Configurations and Named Entry Points -- Wing supports defining multiple launch configurations per project and binding them to particular files for debugging, executing, or unit testing. Named entry points can be used to define easily invoked debug entry points.
- Unit Testing -- Wing's Testing tool works with unittest, doctest, and nose style unit tests. You can run tests suites, view the results, and debug tests.
- Snippets -- The Snippets tool is integrated with Wing's auto-completer to provide a way to quickly 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.
- Version Control -- Wing supports the 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.
- OS Commands -- Wing's OS Commands tool makes it possible to set up and easily execute external command lines. This can also be used to set up a build command for your project that will be executed automatically before each debug sessions.
Customizable User Interface -- Many options are available from Preferences, and you can split tools panels and move around the tools within them. Right click on the tabs for options, or drag tool or editor tabs to move them around or create new splits. Right click on the toolbar to configure which tools are visible or to add your own.
In Wing Pro, use Perspectives in the Tools menu to save named tool panel configurations.
- Other Tools -- Bookmarks, line editing, folding, macros, and many other powerful features are available from Wing's menus. It is also possible to extend Wing IDE by writing Python scripts.
For more information see:
|« How-Tos||Table of Contents||2. How-Tos for Web Development »|