Last active
May 3, 2018 10:54
-
-
Save MahmudHasanCSE/0a0423ba16dbca479ea75ac642900160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import configparser # configparser to read the profiles.ini file in to determine which folder to use | |
mozilla_profile = os.path.join(os.getenv('APPDATA'), r'Mozilla\Firefox') | |
mozilla_profile_ini = os.path.join(mozilla_profile, r'profiles.ini') | |
profile = configparser.ConfigParser() | |
profile.read(mozilla_profile_ini) | |
data_path = os.path.normpath(os.path.join(mozilla_profile, profile.get('Profile0', 'Path'))) | |
# os.path.normpath() is used to ensure backslashes are used. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment