title: How do I run a local Python script on a remote Spark cluster?
body: <p>I have a local Python script running in a Jupyter notebook which runs jobs on my local Spark cluster running on my machine:</p>
  
  <pre><code>sc = pyspark.SparkContext(appName="test")
  sqlCtx = pyspark.SQLContext(sc)
  </code></pre>
  
  <p>How do I change this to connection string to instead runs the jobs on my EMR Spark cluster in AWS?</p>
  
  <p>Is this possible or do I have to use the <code>spark-submit</code> function when SSH'ing into the remote cluster?</p>