[Python] Python pyvenv.cfg Dynamic directory

Discussão em 'Python' iniciado por Stack, Outubro 24, 2024.

  1. Stack

    Stack Membro Participativo

    Is there anyway in the pyvenv.cfg file to dynamically change the users directory dependant on who is logged onto the system? I've created a script on my local computer with the following directory

    C:\Users\ME\AppData\Local\Programs\Python\Python312\python.exe


    Ideally I would like it to dynamically change itself to the profile that's logged in and running the script.

    C:\Users\SERVER\AppData\Local\Programs\Python\Python312\python.exe


    To give an overview of what I'm trying to achieve. I have created a script which I want to run on Task Scheduler everyday. I currently have it working on my local computer, but would prefer it to run on a server which I know will be turned on when the script needs running. I have seen a suggestion that I can run add to my powershell script to change the pyvenv.cfg file everytime the script is run, but would prefer to keep this within python if possible.

    Thanks in advance

    Continue reading...

Compartilhe esta Página