Select to view content in your preferred language

Your 5 most common ArcPy commands that you put into the Python Window?

3755
3
09-25-2012 06:13 PM
Ryan_Galbraith
Occasional Contributor
It seems that arcpy is becoming more and more popular for a quick geoprocessing environment to get work done.

I am just surveying the GIS community to see what are your top 5 commands that you put into the Python window to geoprocess or set overwrite commands etc.

>>> ....5,4,3,2,1 and what you try and accomplish in this command.
0 Kudos
3 Replies
by Anonymous User
Not applicable
Original User: mzcoyle

I mostly use the python window to test code before putting it in a tool or stand alone script. I find I never only do things once, making one off actions in the python window a waste of time. If you want to know the mostly common arcpy functions in any python code I write; I would have to say all the cursors, describe, FCtoFC and various mapping module calls (MapDocument, ListLayers etc). In my library, it is a rare script indeed that doesn't use one (or even most) of those functions.
0 Kudos
Ryan_Galbraith
Occasional Contributor
I was looking for more stuff like...

>>>arcpy.env.workspace = �??Current�?�
>>>arcpy.env.overwirteoutput = True
>>>arcpy.ListPrinterNames()
>>>import os


or the famously
>>>import this




any others that you commonly use?
0 Kudos
by Anonymous User
Not applicable
Original User: ldanzinger

If I'm writing in the Python window (and not PythonWin), I'm typically doing something with the mapping module to do something to all the layers in a map, so some common ones I use are:

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
layers = arcpy.mapping.ListLayers(mxd,"",df)
for layer in layers:
0 Kudos