Forum

Author Topic: launch Metashape gui from python  (Read 2166 times)

spatialdigger

  • Newbie
  • *
  • Posts: 17
    • View Profile
launch Metashape gui from python
« on: July 28, 2021, 03:00:05 AM »
I know you can open a Metashape document into python: doc.open(filepath, read_only=False)

What  I would like to do is launch the program from within python so the user can troubleshoot any identified issues, caught in the script.

For instance if there is an exception the Metashape doc is opened in Metashape for the user to look and apply a manual fix.

I have Metashape pro.

spatialdigger

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: launch Metashape gui from python
« Reply #1 on: July 28, 2021, 08:09:43 PM »
With more research I see that this will be better achieved outside of metashape and purely in python

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: launch Metashape gui from python
« Reply #2 on: July 29, 2021, 05:31:12 PM »
Hello spatialdigger,

I think you can do that using os.system command or subprocess module. Basically you need to use shell command that calls metashape executable with the path to the problematic project as an argument.
Best regards,
Alexey Pasumansky,
Agisoft LLC