| Server IP : 142.11.234.102 / Your IP : 216.73.216.37 Web Server : Apache System : Linux dal-shared-66.hostwindsdns.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64 User : krnuyqrm ( 1183) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /usr/local/lib/python3.6/site-packages/piptools/ |
Upload File : |
# WARNING! BE CAREFUL UPDATING THIS FILE
# Consider possible security implications associated with subprocess module.
import subprocess # nosec
def run_python_snippet(python_executable: str, code_to_run: str) -> str:
"""
Executes python code by calling python_executable with '-c' option.
"""
py_exec_cmd = python_executable, "-c", code_to_run
# subprocess module should never be used with untrusted input
return subprocess.check_output( # nosec
py_exec_cmd,
shell=False,
universal_newlines=True,
)