Skip to content

Instantly share code, notes, and snippets.

@benburry
benburry / echo.py
Last active October 7, 2019 05:05
Python 2 - mock & unittest example for Popen
from subprocess import Popen, PIPE
def shell_out(command):
return Popen(command.split(' '), stdout=PIPE,stderr=PIPE).communicate()[0].strip('\n').split('\n')
def main():
return shell_out('echo one\ntwo\nthree\n')
@bradtraversy
bradtraversy / pipenv_cheat_sheet.md
Last active July 7, 2024 20:34
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell