New answers tagged

1

Look at creating a set of valid animal/year values . feed that into the loop. Using arcpy, run frequency analysis on the data, using the two fields as the frequency fields. The resulting rows will be the valid combinations. With a cursor on the table, read the animal/year into your query. freqFields = ['ANIMAL', 'YEAR'] freq = arcpy.Frequency_analysis(data, ...


0

I have a workaround I've been using in production for 2 years. Not pretty, but works reliably. In your py script you call a batch file which gets a string of user input and writes it to a temp text file. Then python reads that file. The batch file (getInput.bat): @ echo off REM Takes a single line of user input and writes it to an ascii file. More ...


4

You can try to use a python script and use one of the two following modules. But think of it carefully as running a program out of a script can do many unpleasent things. import subprocess subprocess.call(['C:\\folder\\gams.exe']) import os os.system('"C:\\folder\\gams.exe"') Update as it is about a file of the type .gms: Check out the answers on this ...


1

Why don't you use the new possibilities of Python in GRASS 7.x: PyGRASS Your script with an example RG_koor=grass.read_command("v.out.ascii", input="list_points", separator=",", format="point") zeil=RG_koor.split("\n") easting=[];northing=[] for i in range(len(zeil)-1): zeile=[] zeile=zeil[i].split(",") easting.append(float(zeile[0])) ...


0

I just solved this by placing the right files extracted from RPM. Here is where I get my 64bit RPM http://www.filewatcher.com/d/Mandriva/2010.1/x86_64/Sciences/Geosciences/gdal-python-1.7.2-1mdv2010.1.x86_64.rpm.220418.html Using the rpm extraction command provided by http://www.cyberciti.biz/tips/how-to-extract-an-rpm-package-without-installing-it.html I ...


8

Python window is not an equivalent of the Python shell; hence, you won't be able to use the raw_input there. To implement the interactivity with the user, you may choose any of these alternatives: build custom script tools with input parameters (via arcpy.GetParameterAsText()); build Python add-ins (which have text boxes to fill in); use 3rd party Python ...


8

If you want to use the Calculate Field tool (instead of an Update Cursor), what you're assigning to val needs to be an unevaluated python expression. That is, it needs to be identical to the string you would type into the Calculate Field tool if you were using the GUI version. What you're currently assigning to val is "!FEDIRP! !FENAME! !FETYPE!". Any of ...



Top 50 recent answers are included