title: Running function in __main__ .py from command line
body: <p>I've got the following __main__.py file:</p>
  
  <pre><code>def all():
      print "hello world!"
  
  if __name__ == "__main__":
      print "bar"
  </code></pre>
  
  <p>How can I run function <code>all</code> from the command line? The following don't seem to work:</p>
  
  <pre><code>python -c "import __main__; __main__.all()"
  python .
  </code></pre>
  
  <p>I am not allowed to modify the __main__.py file. 
  (This is for a FLOSS project that I'm trying to contribute to)</p>