When I insert a USB memory, I want to automatically execute the python code in the USB.
Is there any way?

macOS Catalina 10.15.1
python 3.7.3

  • Answer # 1

    It often violates security policies.

    If you can do it, don't do it.

  • Answer # 2

    You can't do that on recent operating systems.
    I have to give up.

Related articles