Python ウィンドウとは

ArcGIS 10.0 introduces a new embedded Python experience. The geoprocessing command line has been enhanced to be a fully interactive Python interpreter (or interface) now called 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.

Python ウィンドウを開く

Python ウィンドウは、ArcGIS Desktop アプリケーション内で開くことができます。これを行うには、[標準] ツールバーの [Python ウィンドウ] ボタン Python ウィンドウ をクリックします。

下の図は、Python ウィンドウが初めて開かれたときの表示を示しています。

初めて開かれたときの Python ウィンドウの表示

Python ウィンドウの概要

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:


7/10/2012