os.environ['PYSPARK_SUBMIT_ARGS'] = pyspark_submit_args
filename = os.path.join(spark_home, 'python/pyspark/shell.py')
exec(compile(open(filename, 'rb').read(), filename, 'exec'))
How to run custom Python script on Jupyter Notebook launch (to boot Spark)?