title: Running spark-submit from pycharm
body: <p>I am trying to figure out how to develop apache-spark program in PyCharm.
  I have followed article in this <a href="http://renien.github.io/blog/accessing-pyspark-pycharm/" rel="nofollow">link</a>.
  I define SPARK_HOME and add pyspark to Python path well. There is no error
  in importing pyspark modules and autocomplete works fine.</p>
  
  <p>However I get an error on defining SparkContext when I run the program in PyCharm.</p>
  
  <pre><code>Error: Must specify a primary resource (JAR or Python or R file)
  Run with --help for usage help or --verbose for debug output
  ...
  ...
  Exception: Java gateway process exited before sending the driver its port number
  </code></pre>
  
  <p>I managed to run the program on terminal with submit-spark.
  Do I need to change the configuration on PyCharm or Is there anyway to run
  submit-spark instead of python in PyCharm?</p>