Last active
September 6, 2021 09:38
-
-
Save Lerking/04defb09a017f43c9b8d4fdb77cb37b6 to your computer and use it in GitHub Desktop.
Revisions
-
Lerking revised this gist
Sep 6, 2021 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ from pathlib import Path import configparser -
Lerking created this gist
Sep 6, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #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"))