Starts at root on the Desktop

20 views
Skip to first unread message

Mel Tearle

unread,
Oct 6, 2024, 7:13:46 PM10/6/24
to PyInstaller
The .py file knows where it's located when run from the terminal, but once I've run pyinstaller and moved the .app to the desktop it defaults to '/'.  It's strictly a desktop app, it would be better if it didn't start at root but at the desktop.

bwoodsend

unread,
Oct 7, 2024, 7:09:25 AM10/7/24
to PyInstaller
I'm assuming that by .py files "knowing where they're located" you're talking about current working directories being set to the location of the script. .py files don't set their working directories to where they're located -- they just inherit a working directory from the terminal/IDE that launched them which can be anywhere but is probably somewhere close to the script. (If your code assumes that the working directory is where the script is then it's broken.) When an application is launched by the desktop, it inherits the launch daemon's working directory of root. PyInstaller doesn't and isn't going to interfere with how desktops launch applications.
Reply all
Reply to author
Forward
0 new messages