Skip to content

Instantly share code, notes, and snippets.

View ArmindoFlores's full-sized avatar
:dependabot:
Working

Francisco Rodrigues ArmindoFlores

:dependabot:
Working
  • CERN | IST
  • Geneva, Switzerland
  • 19:17 (UTC +02:00)
View GitHub Profile
@ArmindoFlores
ArmindoFlores / nonblockproc.py
Created April 17, 2021 16:33
Non-blocking python subprocess communication
import os
import subprocess
import sys
import threading
class CustomProcess:
def __init__(self, *popenargs, **popenkwargs):
self._stderr_lock = threading.Lock()
self._stdout_lock = threading.Lock()