RE: Use nectar without using hive-nectar?
You are viewing a single comment's thread:
How do you organize python code for larger projects?
For NodeJS, I find it more intuitive to split up code into submodules with imports and exports.
For python, its less intuitive to me and I end up with a ton of code in a single file. But I would prefer to have smaller files with clear separation of concerns.
0
0
0.000
I break it up into submodules and include the bits and pieces as needed. The easiest way to start a project with submodules is to us
uv init --liband it make the file structure modular instead of (uv initsame asuv init --app) oruv init --scriptwhich is all one file.and in pyproject i'll give a script path: e.g.
synergy = synergy:mainwhich pulls the main function out of__init__.pyby doing that it will give me an executable: in this cases
.venv/bin/synergyor i can run it as a module e.g.python3 -m synergyAlthough, you did just give me some ideas for post content. :)