Last active
September 6, 2021 09:38
-
-
Save Lerking/04defb09a017f43c9b8d4fdb77cb37b6 to your computer and use it in GitHub Desktop.
Reading api_key from wakatime.cfg on Linux
This file contains hidden or 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
| #Reading api_key from wakatime.cfg on Linux | |
| from pathlib import Path | |
| import configparser | |
| home = str(Path.home()) | |
| config = configparser.RawConfigParser() | |
| with open(home + "/.wakatime.cfg", "r") as cfgfile: | |
| config.read_file(cfgfile) | |
| print(config.get("settings", "api_key")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment