import issues python3.4

Matt Wheeler m at funkyhat.org
Fri Nov 10 08:59:50 EST 2017


On Wed, 8 Nov 2017 at 15:58 Heli <hemla21 at gmail.com> wrote:

> Is there anyway I can run my external script without changing the absolute
> path from (1) to (2) in my code.
>

I would recommend using tox [0] to run your test script, and setting up an
entry point in your `setup.py` [1] so that your `main` command is
"installed" when you install the package.
This also means that regular users of your package will be able to run the
script by just typing the command name you choose, instead of needing to
know exactly where the package got installed.


> I use subprocess.call to run main.py within my external script and it gets
> few arguments to run.


tox handles setting up a virtualenv & installing your packages into it,
which means in the context of your tox run, when your test script calls out
to your `main` "entry point" using `subprocess.call` it will be available
in the local $PATH


[0] https://tox.readthedocs.io/en/latest/
[1]
http://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins
-- 

--
Matt Wheeler
http://funkyh.at



More information about the Python-list mailing list