If you write all code under protection __name__, you can never reuse this code. If, on the other hand, you put the code in a function main(), you can always import this function to another place and call it.
, setup.py setuptools, . , script, , script ( sys.path main()).