Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python-window]

For questions about the Python window/console within desktop GIS products like ArcGIS and QGIS

1
vote
2answers
27 views

replaceDataSource() works in ArcMap but not as stand-alone script

I have one script (and one alternative) that I want to use to replace a broken data source. Neither is working outside of the ArcMap Python Window. Has it something to do with the MapDocument object? ...
1
vote
1answer
31 views

Make Query Layer - where are the results?

I'm using MakeQueryLayer to create a view from a database table in the ArcMap python window. The command completes successfully but I can't see the result. Where does it go? arcpy....
0
votes
0answers
31 views

ArcMap10.5 vs python prompt

I have issue that only occurs in the ArcMap 10.5 python window - trying to understand the difference. I have a _segmentation.pyd file that I need the functions in. The line is: from ._segmentation ...
0
votes
0answers
46 views

In ArcMap, when I use PointsToLine in ArcToolbox, error appears

In ArcMap, I open the Python window and print some codes as followed: import arcpy arcpy.env.workspace = "C:/data" arcpy.PointsToLine_management("calibration_points.shp", ...
0
votes
1answer
86 views

Reliably printing messages in ArcMap Python Console?

When finding a solution to a problem by exploratory programming in a REPL I find it very useful to use print statements to build a log and provide insights into application state and flow. ...
0
votes
1answer
59 views

Using ArcGIS python window to change definition query on layer? [closed]

I post a very simple script to the python window to change the definition query on a layer. I save the map and load a new template then try to run the query again and nothing happens. I have ...
1
vote
0answers
85 views

Python Window errors showing when opening up Commands tab in Customize related to Python Add-In?

I'm getting a number of errors in the Python Window on ArcGIS 10.3.1 when going to Customize > Customize Mode... > (Commands Tab) as seen below. The majority of errors are coming from a Python Add-in:...
6
votes
1answer
241 views

Why doesn't the Python window in ArcGIS autocomplete arcpy.Describe objects?

I do a lot of testing in the Python window in ArcGIS Desktop (10.4.1). It's great, especially because it autocompletes code for me. It will autocomplete for most objects: However, something that has ...
1
vote
1answer
141 views

Run field calculator script in Python window

I have a script that runs perfectly in the "Field Calculator." The codeblock looks like this: def timeday(time, am, diur, pm, noc): if(time >=am and time < diur): return "crep_am" ...
2
votes
1answer
86 views

With the same code the Python script won't work, while Python window will

I'm just trying to create a tool that zooms in on a layer and then exports the image as PDF, I'll add more functionality later. The code below will run and produce a PDF, but won't zoom to the layer. ...
3
votes
1answer
42 views

How to add the Python Help and Syntax Box to ArcGIS Pro?

ArcGIS Desktop features a "Help and Syntax Window" in the Python prompt: ArcGIS Pro has removed this feature, which was useful as it both listed and explained parameters: Is there any way to add a ...
0
votes
2answers
100 views

ArcMap python window refusing to execfile after first attempt, requires restart

I am attempting to execute a script mulitple times from the ArcMap python window (using different parameters that are hardcoded into the file). The script runs the first time successfully, however it ...
2
votes
3answers
1k views

Differences between Python window and IDLE for Scripting with ArcGIS Desktop?

I'm making a power point presentation about the differences between Python window and IDLE for my coworkers. I only use the python window to get feedback from my custom toolbars. I tried using it once ...
1
vote
0answers
247 views

Possible to execute external python script from ArcMap Python Window?

I have this python script that I execute inside the ArcMap Python Window and it does an array of spatial analysis processes to get me to my desired final mxd content. I then have another script that ...
9
votes
1answer
1k views

Terminating Python Script in QGIS console?

How do I terminate any script in QGIS python console window? ctrl + c does not work
4
votes
1answer
744 views

Does progress bar of ArcPy show when code run from Python window?

I am learning the usage of SetProgressor. I used the sample code from ArcGIS guide to test, as shown below. import os import arcpy # Allow overwriting of output arcpy.env.overwriteOutput = True # ...
0
votes
2answers
452 views

Printing to Python window of ArcMap using different font colors?

Can i highlight the print raster in different color? Below I have attached the shapshot, where i trying to highlight in different color only print raster, I have underlined where i trying to put ...
2
votes
1answer
97 views

ArcPy - MapDocument CURRENT error in 10.4

I'm running 10.4 and occasionally get an error when running scripts with the line; mxd = arcpy.mapping.MapDocument("CURRENT") Error message: CreateObject cannot open map document Note "Always run ...
2
votes
1answer
76 views

Is it possible to inherit a session in ArcGIS 10.0 through the Python window?

So, I'm still struggling with an ESRI 10.0 installation with an Oracle ArcSDE database. I'm nearing the end .... In trying to programmatically edit the versioned data. It needs to be done in an ...
4
votes
4answers
11k views

ImportError: No module named pandas in Python window of ArcMap after installing with pip?

I have downloaded pandas from this site then unzipped it in site-packages and run python setup.py for installing pandas. Pandas was installed successfully. After that I tried importing pandas into ...
0
votes
0answers
21 views

using import ogr in Arcgis python [duplicate]

I need to use import ogr in my python window provided by ArcGIS 10.2, but i can't configure ogr and gdal on my system. How can I fix this issue and import ogr in my python window provided by ArcGIS ...
3
votes
0answers
452 views

Import processing module from QGIS into Python Window of ArcCatalog?

It is possible to import processing module from QGIS and run it in Python Window of ArcCatalog? I tred in qgis import sys output = sys.path and copy output to arcgis console: import sys for x ...
0
votes
1answer
543 views

Using pandas in Python window of ArcGIS for Desktop?

How can I import pandas module in ArcGIS at figure. I want to calculate poisson and negative binomial, so I think I need import pandas or other modules. import pandas as pd Runtime error ...
0
votes
1answer
3k views

Error 000728 field does not exist within table - field already exists

I am running arcpy.AddField_management to add a field called "cnid" and update it with x centroid values. For add.field I get the error "cnid" already exists. I tried print.field name and I cannot ...
10
votes
2answers
16k views

Executing script in Python window of ArcMap?

I've been writing Python in my text editor so I have a Python script, script.py. I'm still developing it so don't want to put it in my toolbox yet, and at the moment this means copying and pasting it ...
2
votes
2answers
196 views

Executing Python script from .NET AddIn and also write its standard output and geoprocessor messages to ArcMap Python Window?

Can a Python script be executed from a .NET AddIn and also write its standard output and geoprocessor message to the ArcMap Python Window? I have no problem call python scripts with Process.Start or ...
9
votes
1answer
837 views

Any performance difference between Python window and Python script tool?

Is there a difference in performance between running a Python script in the Python window versus running it as a Python script tool from the toolbox in ArcGIS Desktop 10.0? Sometimes I need to use ...
20
votes
7answers
36k views

How to manually break statement execution in Python window of ArcMap?

How does one break the execution of a long-running process in the python console of ArcMap? For example, how do you break a long iteration like the one below once it is started? for i in range(1, 50)...
5
votes
1answer
1k views

Python window vs Toolbox script in ArcGIS for Desktop?

My question is similar to Adding Layer in current session using ARCPY . My script works in ArcMap python window but not as a script in toolbox. I am running ArcGIS 10.0 SP4. The script is given below,...
10
votes
1answer
2k views

Importing GDAL from Python window of ArcGIS for Desktop?

I am trying to run some Python code using the Python window in ArcGIS 10.1 that uses both the arcpy and gdal modules. However, when I try and import the gdal module I get an error: ImportError: No ...