Before starting with some code, let's make sure that Wing has succeeded in finding your Python installation (the latest version is preferred if you have multiple versions installed). To check this, bring up the Python Shell tool. After a moment, it should show you the Python command prompt like this:
If this is not working, or the wrong version of Python is being used, you can point Wing in the right direction with the Python Executable setting in Project Properties, available from the toolbar and Project menu. You will need to Restart Shell from Options in the Python Shell tool after altering this property.
Once the shell works, copy/paste or drag and drop these lines of Python code into it:
for i in range(0, 10): print(' ' * (10 - i) + '*' * i)
This should print a triangle as follows:
Notice that the shell removes common leading white space when blocks of code are copied into it. This is useful when trying out code from source files.
Now type something in the shell, such as:
import sys sys.getrefcount(i)
Note that Wing offers auto-completion as you type and shows call signature and documentation information in the Source Assistant.
You can create as many instances of the Python Shell tool as you wish; each one runs in its own private process space that is kept totally separate from Wing IDE and your debug process.
|« 1.1. Tutorial: Getting Around Wing IDE||Table of Contents||1.3. Tutorial: Set Up a Project »|