Python Project Tasks: Quick Reference

This topic describes common tasks you can perform with Python projects.

To perform this task Follow these steps
Create New Project
  1. In the IDE go to File > New Project > Python Project
  2. Under Categories select Python, under Projects select Python Project
  3. For Name and Location you must do the following:
    • Project Name. Specify the name of the project. This name is also used to create the project directory.
    • Project Location. Specify the location of the directory where you want to store the project metadata and source code.
    • Set as Main Project. Set the newly created project as the main project if desired.
    • Create Main File. Specify the name of the main file if needed.
    • Python Platform. Select the Python platform to use for your project.
  4. Click Finish and the project is created and opened in both the Projects and Files windows.
Create New Project from Existing Sources
  1. In the IDE go to File > New Project > Python Project with Existing Sources
  2. In the Name and Location page, you have to set the following properties:
    • Project Name. Specifies the display name of the project. This name is also used to create the project folder.
    • Project Location. Specifies the folder where you want to store the project metadata and source code.
    • Set as Main Project. Sets the newly created project as the main project.
    • Python Platform. You can select the Python platform to use for your project.
  3. In the Existing Sources page, you have to set the following properties:
    • Source Root Folders. Specify the root directory of the existing sources.
    • Test Root Folders. Specify the root directory of the existing tests.
  4. When you click Finish, the project is created on your computer and opened in both the Projects and Files windows.
Running Python Applications
  1. To run a project, right-click the project node in the Projects window and choose Run. (or F6 to run the Main Project).
  2. To Run a file, click on the file name in the Projects window and choose Run > Run File.
Debugging Python Applications
  1. Go to Tools > Options, click Python, then the Debugger tab.
  2. Set the Debugger listening starting port.
  3. Use the default Debugging shell colors and fonts, or modify as you prefer.
  4. Leave Stop at First Line checked to stop the debugger script after one line, or uncheck the box and the debugger will stop at the first found breakpoint in script.
  5. Set breakpoints in the Source Editor by clicking in the left margin next to the line of code where you want to set a breakpoint.

For additional details please see Debugging Python Applications.

Adding New Python Modules
  1. Right-click on the project node and choose New > Empty Module.
  2. In the Name and Location page, set the following properties:
    • File Name. Name of the new module
    • Project. The project that this module will be added to.
    • Folder. The directory which you want the module to be created.
  3. Click Finish and the new module is added to the project with a default code template.
Adding New Python Packages
  1. Right-click the Project node and choose New > Python Package
  2. In the Name and Location page, you have to set the following properties:
    • File Name. Name of the package.
    • Project. The project that this module will be added to.
    • Folder. The directory which you want the module to be created.
  3. When you click Finish, the package is added to the project with a default file already added.
Using the Python Interactive Console
  1. Go to Window > PythonConsole.
  2. Add the Python script you wish to run to the Python Interactive Console window.
  3. Click the green Run button on the left border of the output window to Run the script.
Managing Python Platforms

In the IDE go to Tools > Python Platforms. The Python Platform Manager enables you to do the following:

  • Add and Remove Platforms.
  • Specify which Python runtime, CPython or Jython, to use as a default.
  • Choose which CPython is used.
  • Specify values for command line arguments.
  • Set, Add and Remove Global Python Path variables.
  • Set, Add and Remove Java Classpath variables.

Legal Notices