Pour en savoir plus sur les équivalents Python des fonctions AML
ABREVIATIONS |
<non prise en charge>
AMLPATH |
<non applicable>
ARGS < var ... var > |
import arcpy
arcpy.GetParameterAsText(var)
ATOOL |
<non applicable>
CALL |
<non applicable>
CODEPAGE ANSI |
import locale
locale.setlocale(locale.LC_ALL, "")
COMMANDS |
import arcpy
for tool in arcpy.ListTools():
print tool
CONV_WATCH_TO_AML |
<non applicable>
DALINES |
<non applicable>
DATA |
instructions exec ou eval
DATEFORMAT |
Utilisez plusieurs fonctions dans le module de temps. Consultez la fonction AML DATE -DFMT pour plus d'informations.
DELVAR < variable ... variable > |
del variable
DESCRIBE < geo_dataset > |
import arcpy
desc = arcpy.Describe(geo_dataset)
print desc.type
DO &LIST |
for <target> in <list>:
<statements>
DO &REPEAT |
while <expression>:
<statements>
DO &TO &BY |
for <target> in <list>:
<statements>
DO &UNTIL < expression > |
while not <expression>:
<statements>
DO &WHILE < expression > |
while <expression>:
<statements>
DO |
instructions for ou while
ECHO |
<non applicable>
ENABLE |
<non applicable>
ENCODE |
<non applicable>
FLUSHPOINTS |
<non applicable>
FORMAT |
<non applicable>
FULLSCREEN |
<non applicable>
GETLASTPOINT |
<non applicable>
GETPOINT |
<non applicable>
GOTO |
<non applicable>
IACRETURN |
<non applicable>
IF THEN ELSE |
if <testcase1>:
<statements1>
elif <testcase2>:
<statements2>
else:
<statements3>
LABEL |
<non applicable>
LISTCHAR |
<non applicable>
LISTFILES |
<non applicable>
LISTGLOBAL |
<non applicable>
LISTLOCAL |
<non applicable>
LISTPROGRAM |
<non applicable>
LISTVAR |
<non applicable>
MENU |
<non applicable>
MENUPATH |
<non applicable>
MESSAGES |
<non applicable>
PAUSE < prompt > &SECONDS < secs > |
import time
print prompt
time.sleep(secs)
POPUP <file> <string_list> |
from Tkinter import *
def PopupList(title, list):
root = Tk()
root.title(title)
root.protocol("WM_DELETE_WINDOW", root.quit)
frame = Frame(root)
vScrollbar = Scrollbar(frame, orient=VERTICAL)
hScrollbar = Scrollbar(frame, orient=HORIZONTAL)
listbox = Listbox(frame, selectmode=SINGLE, xscrollcommand=hScrollbar.set, yscrollcommand=vScrollbar.set)
vScrollbar.config(command=listbox.yview)
vScrollbar.pack(side=RIGHT, fill=Y)
hScrollbar.config(command=listbox.xview)
hScrollbar.pack(side=BOTTOM, fill=Y)
listbox.pack(side=LEFT, fill=BOTH, expand=1)
frame.pack()
for a in list:
listbox.insert(END, a)
root.mainloop()
root.destroy()
file = sys.argv[1]
string_list = sys.argv[2] # semi-colon delimited string
sList = l.split(";")
f = open(file, 'r')
line = f.readline()
while len(line) <> 0:
sList.append(line)
line = f.readline()
PopupList(file, sList)
PT |
<utilisez la méthode GetMessages pour extraire le temps d'exécution d'un outil>
PUSHPOINT |
<utilisez l'objet géométrie et les curseurs pour créer et modifier des entités>
RETURN |
<non applicable>
ROUTINE |
<non applicable>
RUN |
<non applicable>
RUNWATCH |
<non applicable>
SELECT |
<non applicable>
SELCHAR |
<non applicable>
SELVAR |
<non applicable>
SEVERITY |
<non applicable>
SHOW |
<non applicable>
STATION |
<non applicable>
STOP |
<non applicable>
SYSTEM < command > |
import os
os.system(command)
TB |
<non applicable>
TERMINAL |
<non applicable>
TEST |
<non applicable>
THREAD |
<non applicable>
TRANSLATE |
<non applicable>
TTY |
<non applicable>
TYPE < message > |
print message
USAGE < command > |
import arcpy
arcpy.Usage(command)
WATCH |
<non applicable>
WORKSPACE < path > |
from arcpy import env
arcpy.env.workspace = path