Skip to content

Instantly share code, notes, and snippets.

@binary-signal
Created October 31, 2017 07:22
Show Gist options
  • Save binary-signal/4942dadde26466fbfa8c9c89192fd49e to your computer and use it in GitHub Desktop.
Save binary-signal/4942dadde26466fbfa8c9c89192fd49e to your computer and use it in GitHub Desktop.
pid to file
def mark_me(main_file):
pid = os.getpid()
with open('proc.pid', "w") as f:
f.write("{} pid:{} ".format(os.path.basename(main_file), pid))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment