subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
for pkg in packages: try: print(f"正在安装 {pkg}...") result = subprocess.run([sys.executable, "-m", "pip", "install", pkg], capture_output=True, text=True, timeout=300) if result.returncode == 0: results.append(f"✓ 成功安装 {pkg}")- Confidence
- 91% confidence
- Finding
- result = subprocess.run([sys.executable, "-m", "pip", "install", pkg], capture_output=True, text=True, timeout=300)
