I want to access the following path on Ubuntu in my python code:
~/.mozilla/firefox/dh4ytbdj.default/bookmarkbackups
which contains Firefox bookmarks
The problem is that the part before the ‘.default‘ is different for every user and machine.
Is there a way that I can specify a general path for this directory and make python access it and retrieve the desired file?
And is it possible to implement the ‘~‘ in python code to access current user’s home?
For system-wide access of personal firefox directories (with sufficient rights) you could try:
As @NedBatchelder noted, this can be combined into one command:
which returns one (if existing) path.