How to use 'python launcher' in Python

Every line of 'python launcher' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
18def python_switcher(python_exec: str, python_file: str, args: list):
19 '''
20 Switch to the right python
21 '''
22 if not os.getpid() - os.getppid() == 1:
23 subprocess.call(['%s %s %s' % (python_exec, python_file, ' '.join(args))], shell=True)
24 else:
25 sys.exit(1)

Related snippets