ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

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
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Customizing the Python window

  • Python window context menu

The Python window recognizes the system environment variable PYTHONSTARTUP. If PYTHONSTARTUP has been previously set to a Python file, Python will automatically execute that file's code when the Python window is opened. This is a useful way to ensure that your Python window experience starts with all your commonly used Python utilities preloaded.

To add the PYTHONSTARTUP environment setting, do the following:

  1. Right-click My Computer and click Properties.
  2. Click the Advanced tab and click Environment Variables.
  3. Under System variables, click New.
  4. Add PYTHONSTARTUP to Variable name.
  5. Add the path of the Python file to Variable value and click OK.
  6. Click OK.

Below is one possible startup file. If PYTHONPATH has been set to this startup file, when you open the Python window, arcpy, numpy, and time will already be imported, and the overwriteOutput setting will be turned on.

# My startup file 
import arcpy 
from arcpy import env
import numpy 
import time 
env.overwriteOutput = True

Python window context menu

Right-click in the Python window or the Python window help and syntax pane to view the context menu for that section.

Python window context menu

Show Default Choices

When checked, code completion will provide available options.

Add To Results

When checked, tools executed in the Python window will be added to the Results window.

Load

Load an existing Python file.

Save As

Save Python window contents to a Python or text file.

Help Placement

This describes where the Help pane will be placed, relative to the main prompt.

Format

Change Python window theme and character fonts and colors.

Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

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

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal