Doesn't python have an OS module that you can call?
os.system(your application, your parameter)
My question is now answered and the solution is much better than my original idea.Using the method below I can now create a Python script that calls an ArcMap Console Application and that passes an argument with a name of the map that Python wants the Console Application to update. The Console Application is able use the IAppROT interface to get an application hook to the Map that Python wants updated and can then do things using ArcObjects code that arcpy mapping cannot do. Python can pass as many additonal standard C type (char, int, date, etc.) arguments that the Console Application may need to coordinate its actions with the Python script. I am fairly certain that the Console application can pass back a result to Python using the method outlined below as well.Therefore, there is no need to wait on the user to do anything to coordinate the triggering of the code, or to use an Add-in extension event listener, or store notification text objects in the map to handle communications between Python and ArcObjects.The Python subprocess.check_call method works for calling an ArcMap Desktop Console Application with arguments in this format:from subprocess import check_call
check_call(["DesktopConsoleApplication1.exe", "Collision_Segment_Diagram2.mxd"])
The following ArcMap Desktop Console Application code worked to notify me whether or not a map is open and whether or not it matches the title python passed as an agrument to the console application:using System;
using System.Collections.Generic;
using System.Text;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Framework;
namespace DesktopConsoleApplication1
{
class Program
{
private static LicenseInitializer m_AOLicenseInitializer = new DesktopConsoleApplication1.LicenseInitializer();
[STAThread()]
static void Main(string[] args)
{
//ESRI License Initializer generated code.
m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeArcView, esriLicenseProductCode.esriLicenseProductCodeArcEditor, esriLicenseProductCode.esriLicenseProductCodeArcInfo },
new esriLicenseExtensionCode[] { });
//ESRI License Initializer generated code.
try
{
IAppROT aprot = new AppROT();
IApplication application = null;
for(int a = 0; a < aprot.Count; a++)
{
application = aprot.get_Item(a);
System.Console.WriteLine("Application Title = " + application.Document.Title);
foreach (string curItem in args)
{
System.Console.WriteLine("Args: " + curItem);
if (application.Document.Title == curItem)
{
System.Console.WriteLine("The map was found! Do something!");
}
else
{
System.Console.WriteLine("The open map does not match that title.");
}
}
}
if (aprot.Count == 0)
{
System.Console.WriteLine("No ArcMap application is open");
}
//System.Console.ReadLine(); //Uncomment this line if you want to have the console pause before closing.
}
catch (Exception e)
{
Console.WriteLine("{0} Exception caught.", e);
}
//Do not make any call to ArcObjects after ShutDownApplication()
m_AOLicenseInitializer.ShutdownApplication();
}
}
}