Forum

Author Topic: Access script path from inside GUI?  (Read 2638 times)

Wizyza

  • Newbie
  • *
  • Posts: 26
    • View Profile
Access script path from inside GUI?
« on: April 10, 2024, 11:51:37 PM »
Hi everyone,

If you are running a script from inside the GUI (using Tools > Run script, or Ctrl + R), is it possible to access the path to the script you are using?

I have another file I want to access that is in the same folder as the script.

Thanks!


Wizyza

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Access script path from inside GUI?
« Reply #1 on: April 11, 2024, 05:24:27 PM »
Hi everyone,

You can disregard this post. This turns out to not be a Metashape issue.

I wasn't aware of using the __file__ variable in Python. My script can now access files outside of itself.