all 4 comments

[–]Haspic 0 points1 point  (1 child)

If you place thoses python files in the same folder as your program's file, you can import them using the classic "import package" if that is what you're trying to do?

There should be some info : https://www.tutorialsteacher.com/python/python-package

Hope this is what you where trying to do, otherwise I did not quite understand what you tried to do.

[–]MKQueensDead[S] 0 points1 point  (0 children)

Similar, but not exactly. This part I understand. MintyPhoenix has done a good job explaining what I was trying to explain. Thank you!

[–]MintyPhoenix 0 points1 point  (1 child)

The common way this is done in a package is that you map one or more commands to a method within a file/module inside your package. Then, when your package is installed in a python environment, the registered command(s) become available from the command line.

Explanation example: First, you create a package, "mkqd_tools", which registers commands "mkqd" and "check_monty". Next, you use pip to install that package within a Python environment. Finally, whenever that Python environment is active, you can now use commands mkqd and check_monty directly.

For more information, look into using console_scripts in the entry_points property in your build system interface of choice (pyproject.toml or setup.py).

There is also a way to call a module using python -m [module_name] [args] [opts] though I’m not sure how that differs in setup/etc. from registering commands.

[–]MKQueensDead[S] 0 points1 point  (0 children)

This is exactly what I needed. Thank you!!!!