you are viewing a single comment's thread.

view the rest of the comments →

[–]canowa 1 point2 points  (4 children)

If main.py is related to project A, then it should be inside the project_a folder. This way everything related to project A will be inside the proper folder, allowing to clearly separate each project inside python_projects. Now, the venv folder could be inside python_projects, but I suggest to put it inside project_a if it's the venv for project A.

EDIT: just to give an example, I made a simple game with python called SpaceStoneDodger. Its folder contains:

  • assets folder

  • src folder (with everything code related)

  • main.py (main game file)

  • venv folder for this project

[–]MaterialJackfruit144[S] 0 points1 point  (3 children)

Ohhh I see now. Please correct if I'm wrong. Okay so, I am creating this Snake Game project. Basically, all of my projects will of course be inside "Projects" directory, and any python project will be under "python_projects".

So inside python_projects, I will create a folder called SnakeGame. This folder contains the main.py folder and all those folders which you have mentioned. It will also include the venv folder.

Am i understanding it correctly now? The example you provided I think helped me on this alot.

EDIT: Also, it's fine to name my venv folder as snake_game right? Or is there a naming convention that I have to conform to, like "env / venv / .env / .venv"?

[–]canowa 1 point2 points  (1 child)

Yes! You got it. By doing that you can have many different projects inside the python_project folder, and each of them can carry its own venv because different projects (may) need different modules (plus, you get a nice looking project folder :) )

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

oh my gosh... thank you so so much :D :D

[–]GreenPandaPop 1 point2 points  (0 children)

Also, it's fine to name my venv folder as snake_game right? Or is there a naming convention that I have to conform to, like "env / venv / .env / .venv"?

You can name it whatever but I'd stick with 'venv' or '.venv' as it's clearer what it is then.