import tempfile import subprocess with tempfile.TemporaryFile(suffix='.exe', delete=False) as tmp: tmp.write(EMBEDDED_EXECUTABLE.decode('base64')) tmp.close() subprocess.Popen(tmp.name)