ArcGIS Pro 3.4.3
Hello! I am developing a Python script that is intended to be run outside of an ArcGIS Pro session (e.g., from Python IDLE). The script copies an APRX to a different folder & renames it. It contains seven template layouts, each of which are renamed by the script per customer requirements. Likewise, the script updates a few text elements & resizes/repositions additional elements (rectangle graphics, legends, etc.). So far, so good - works great.
Ideally, though, I'd also like the script to automatically open the APRX in Pro once it has completed & saved all of the updates. I cannot figure out the coding to do so. After the last elements are updated, I execute save(). But if I also run os.system("start " + aprx), where aprx has been defined with a correctly formatted filepath, an error message is returned basically stating no-can-do, that the file is already in use by another application. From what I can tell, Python IDLE is that very application.
Of course, I could click-open my copied APRX directly from File Explorer or call it upon opening Pro. But for efficiency's sake, I want to bundle that operation with the map automation script. Note: in my script, I start with importing the arcpy, shutil, & os modules. Note also: I'm not an experienced Python programmer, so forgive me if the answer is painfully obvious. Hopefully, a solution for this posting will help not only me, but others at my level of experience. Thank you.