Skip to main content
added 53 characters in body
Source Link
GeoStoneMarten
  • 1.2k
  • 10
  • 26

If you want open mxd in new process you can use

import subprocess
subprocess.Popen(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

for a syncronous process

import subprocess
subprocess.Call(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

But you need close the new before the first.

Don't use

os.system("TASKKILL /F /IM ArcMap.exe")

because it close all ArcMap process windows

but you can use

import os
import signal
os.kill(os.getpid(), signal.SIGTERM)

That create a new windows... But that do the work

If you want open mxd in new process you can use

import subprocess
subprocess.Popen(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

for a syncronous process

import subprocess
subprocess.Call(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

But you need close the new before the first.

Don't use

os.system("TASKKILL /F /IM ArcMap.exe")

because it close all ArcMap process windows

but you can use

import os
import signal
os.kill(os.getpid(), signal.SIGTERM)

If you want open mxd in new process you can use

import subprocess
subprocess.Popen(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

for a syncronous process

import subprocess
subprocess.Call(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

But you need close the new before the first.

Don't use

os.system("TASKKILL /F /IM ArcMap.exe")

because it close all ArcMap process windows

but you can use

import os
import signal
os.kill(os.getpid(), signal.SIGTERM)

That create a new windows... But that do the work

Source Link
GeoStoneMarten
  • 1.2k
  • 10
  • 26

If you want open mxd in new process you can use

import subprocess
subprocess.Popen(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

for a syncronous process

import subprocess
subprocess.Call(["C:/Program Files (x86)/ArcGIS/Desktop10.3/bin/ArcMap.exe", 'D:/temp/test.mxd']

But you need close the new before the first.

Don't use

os.system("TASKKILL /F /IM ArcMap.exe")

because it close all ArcMap process windows

but you can use

import os
import signal
os.kill(os.getpid(), signal.SIGTERM)