Calling Python package from command line / PyCharm
<p>I am creating a Python package, I anticipate that it will be called both by command line and from other scripts. Here is a simplified version of my file structure:</p>

<pre><code>GREProject/
    __init__.py
    __main__.py
    Parsing.py
</code></pre>

<p>Parseing.py contains a method, parse(), it takes two arguments, an input file and an output file. I am trying to figure out the proper code for "__main__.py" so that when the following is called from the command line or terminal the arguments will be passed to "parse()":</p>

<pre><code>Python GREProject -i input.file -o output.file
</code></pre>

<p>I have tried this numerous ways but they have all met with failure, I do believe I need the "-m" flag for the interpreter but more than that I don't know. Example with the flag:</p>

<pre><code>Python -m GREProject -i input.file -o output.file
</code></pre>

<p>When running the later command I receive the following error:</p>

<pre><code>Import by filename is not supported.
</code></pre>

<p>Presumably from this line:</p>

<pre><code>from . import Parsing
</code></pre>