Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Iterate a script that calls to an .exe for variables?

$
0
0
I have a tool that I would like to run on each file in a folder. The tool runs in arcmap and is a python shell that concocts a command line command that then calls to an .exe.

Is there a way to hard code within the python script variables the .exe is looking for? There are 7 variables, they will all remain the same aside from the first, which will just change for each FeatureClass.

Some of the code is as follows:


HTML Code:

### maybe an output file name was selected
if sys.argv[5] != "#":
    command.append("-o")
    command.append('"'+sys.argv[5]+'"')

### maybe an output directory was selected
if sys.argv[6] != "#":
    command.append("-odir")
    command.append('"'+sys.argv[6]+'"')

### maybe an output appendix was selected
if sys.argv[7] != "#":
    command.append("-odix")
    command.append('"'+sys.argv[7]+'"')


Viewing all articles
Browse latest Browse all 2485

Trending Articles