Skip to content

Instantly share code, notes, and snippets.

@Lerking
Last active September 6, 2021 09:38
Show Gist options
  • Select an option

  • Save Lerking/04defb09a017f43c9b8d4fdb77cb37b6 to your computer and use it in GitHub Desktop.

Select an option

Save Lerking/04defb09a017f43c9b8d4fdb77cb37b6 to your computer and use it in GitHub Desktop.
Reading api_key from wakatime.cfg on Linux
#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