Skip to content

Instantly share code, notes, and snippets.

@allanlei
Created August 27, 2014 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allanlei/33795c741018e7b2c958 to your computer and use it in GitHub Desktop.
Save allanlei/33795c741018e7b2c958 to your computer and use it in GitHub Desktop.
Parse Procfile
def procfile(filepath):
with open(filepath, 'rb') as fp:
for process_line in fp.readlines():
process_line = process_line.strip()
if not process_line or process_line.startswith('#'):
continue
process_name, command = process_line.split(':', 1)
yield process_name.strip(), command.strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment