ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

What is the Python window?

  • Opening the Python window
  • An overview of the Python window

The Python window is an efficient and convenient location to use geoprocessing tools and Python functionality from within ArcGIS. The Python commands run from this window can range from single lines of code to complex blocks with logic. The Python window also provides a place to access additional functionality using custom or third-party Python modules and libraries.

The Python window also acts as a gateway to Python for those new to scripting, providing an intuitive interface that makes learning Python scripting in ArcGIS as easy as possible. In the Python window, various tool and method usage and syntax can be viewed or experimented with, and snippets of Python code can be entered or pasted into the window to test scripting ideas outside a stand-alone script. The Python window is a powerful mechanism for efficiently accessing and executing geoprocessing and scripting tasks and increasing productivity by placing Python functionality within ArcGIS Desktop applications.

Opening the Python window

The Python window can be opened within any ArcGIS Desktop application by clicking the Python window button Python on the Standard toolbar.

Below shows how the Python window appears when first opened:

Python window as it appears when first opened

An overview of the Python window

Once opened, the Python window can be moved by clicking the bar at the top and dragging to your preferred location. The window can be docked or undocked.

The window prompts for the next command with the primary prompt, three greater-than signs (>>>), and continuation lines prompt with the secondary prompt, three dots (...).

Continuation lines are needed when entering a multiline construct. See the following example using an if statement:

Python window with Python code

The Python window contains two sections:

  • The Python section on the left. This is where commands are entered.
  • The Help section on the right. This is where command usage, help, and execution messages are viewed. This section can be hidden or placed to the right, left, top, or bottom of the Python section.

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal