subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# 尝试 which/where for cmd in ["where soffice", "which soffice", "which libreoffice"]: try: result = subprocess.run(cmd, shell=True, capture_output=True, text=True) if result.returncode == 0 and result.stdout.strip(): return result.stdout.strip().split("\n")[0] except Exception:- Confidence
- 91% confidence
- Finding
- result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
