[Python] How to use .profile correctly on Linux?

Discussão em 'Python' iniciado por Stack, Maio 19, 2025.

  1. Stack

    Stack Membro Participativo

    I'm making a simple app in python and there is an option to run the app on user login. I am only passingly familiar with Linux but I found out that you can make apps run on user login by adding a line in ~/.profile that runs the app. I want to know if what I'm doing is correct:

    Through the python script I'm opening .profile in append mode and writing the following line:

    (cd <INSTALLATION_DIRECTORY> && ./AppOpener.sh)

    It works as intended but I'm wondering if using such a method is ok in the .profile file.

    I can't just do ./INSTALLATION_DIRECTORY/AppOpener.sh because AppOpener.sh uses a relative path and therefore doesn't work when run from a different directory

    Continue reading...

Compartilhe esta Página