selenium_port = 4455
selenium_folder_path = '/wherever/selenium/lies'
env = os.environ
env['DISPLAY'] = ':%d.0' % display
command = ['java', '-server', '-jar', 'selenium-server.jar', '-port', str(
    selenium_port)]
log = open(log_file_path, 'a')
selenium_server_process = subprocess.Popen(command, cwd=
    selenium_folder_path, stdout=log, stderr=subprocess.STDOUT, env=env)
Killing a subprocess including its children from python