I have a python program that is calling an external command. The command needs to look like this:
java -jar ../GeoNetCWBQuery-4.0.2-bin.jar -s "NZMQZ..HH..." -d 3600 -event:time
"2004/12/26 00:58:50" -event:lat "3.3" -event:lon "95.78" -event:depth "10.0"
-o %c%s%y%/M%/D%z
In the python program I have assigned names to the values which need to go into the command i.e. date, time, lat, lon, depth. (I can't just type in the values as I am looping over a huge file.) So my question is, how do I write it out i.e how do I insert the values into the command correctly. At the moment I have (which is not working):
os.system('java -jar GeoNetCWBQuery-4.0.2-bin.jar -s "NZMQZ..HH..." -d 3600
-event:time " + date + +time + " -event:lat " + lat + " -event:lon " + lon +
" -event:depth " + depth + " -o %c%s%y%M%D%z')