Python:How ot build a distribution file?
<p>I have created the setup.py file.
But I don't know how to make a distribution?
The book said that Open a terminal window and type a single command: python3 setup.py sdist.
I did that but always get error!
I feel the code is ok, because it is just the example in the book.
I guess the error is from the way I build the distribution.
In the python command line terminal, how to change  directory? </p>

<p>the code of file nester.py goes like following:</p>

<pre><code>    def print_lol(the_list):
    for each_item in the_list:
    if isinstance(each_item, list):
    print_lol(each_item)
    else:
    print(each_item)
</code></pre>

<p>the setup.py file is as following:</p>

<pre><code>from distutils.core import setup
setup(
name = 'nester',
version = '1.0.0',
py_modules = ['nester'],
author = 'hfpython',
author_email = 'hfpython@headfirstlabs.com',
url = 'http://www.headfirstlabs.com',
description = 'A simple printer of nested lists',
)
</code></pre>

<p>and the command I type in is: <code>python3 setup.py sdist</code>
then I get the error:</p>

<pre><code>File "&lt;stdin&gt;",line 1
 pythons setup.py sdist
syntaxError: invalid syntax
</code></pre>
