Sorry, I'll try to reword what it is I am doing. The .rpl is the program itself ( I probably should have mentioned this is the program I am using instead of refering to it as a file). It is an interface that allows me to find and replace tags in with values .xml files which I want to import into feature classes later on. The .rpl is the executable.
I'm thinking that if I interpret what you have said, Logan, is that my first argument should be the location of the program I want to call (or open) and the second argument should be the file or files that I want to run it against (ie the .xml)?
Basically my current process is this:
1. open the .rpl program
2. enter the information that I need to edit (ie user name, dates, project site name, email address, etc...)
3. Run that against 12 template .xml files which finds tags and string variables and replaces them with the information I entered into the .rpl program
4. Import .xml into the metadata to the matching feature class.
5. Fin
I hope this makes it a little more clearer as to my process and end result.
Actually, the os.startfile() runs pretty cool. It might be more of what I am looking to do. I'm thinking it might take a little more than my abilities to make this program run in the background the way I would like.
My thought process now is maybe just to prompt the script to run like this:
1. Run my python script and let it process my maps, layers, etc
2. When the script gets to the block to os.startfile(my.rpl program), the .rpl opens and in the same breath, pauses the python program
3. allow user to enter the information in the .rpl program and run it.
4. when they close the .rpl program, the rest of the python script continues on
I see some syntaxes like os.wait() that may pause the python script, maybe something like os.when_program_closes_continue_python....just reaching at straws now 🙂
That sounds correct but I have not heard of this .rpl program and couldn't say how it should be called on the command line. But to me it still sounds like the .rpl is a file that is run by some other executable you have not specified as of yet.
Using subprocess.call() should pause the script until the called process terminates.
subprocess.call(['C:\Downloads\Multiple File Search Replace\REPLACE.exe','C:\Downloads\Multiple File Search Replace\Noname.rpl'])