# This program uses the subprocess module's Popen function to launch programs

import subprocess

# Launching Other Programs from Python
calcProc = subprocess.Popen('/usr/bin/gnome-calculator')
print(calcProc.poll() is None)
print(calcProc.wait())
print(calcProc.poll())

# Passing Command Line Arguments to Popen()
subprocess.Popen(['/usr/bin/gedit', '/home/jose/Documents/Notepad.py'])  # Using Ubuntu 18.04

# Running Other Python Scripts
subprocess.Popen(['/usr/bin/python3',
                  '/home/jose/PycharmProjects/python-tutorials/books/'
                  'AutomateTheBoringStuffWithPython/Chapter01/P02_hello.py'])

# This program uses the subprocess module's Popen function to launch programs

import subprocess

# Launching Other Programs from Python
calcProc = subprocess.Popen('/usr/bin/gnome-calculator')
print(calcProc.poll() is None)
print(calcProc.wait())
print(calcProc.poll())

# Passing Command Line Arguments to Popen()
subprocess.Popen(['/usr/bin/gedit', '/home/jose/Documents/Notepad.py'])  # Using Ubuntu 18.04

# Running Other Python Scripts
subprocess.Popen(['/usr/bin/python3',
                  '/home/jose/PycharmProjects/python-tutorials/books/'
                  'AutomateTheBoringStuffWithPython/Chapter01/P02_hello.py']).communicate()

Update P08_popenFunction fixed python script not prompting for input