[Python] Windows directory structure for VS Code Python projects

Discussão em 'Python' iniciado por Stack, Janeiro 31, 2025.

  1. Stack

    Stack Membro Participativo

    I'm on a Windows 10 host using VS Code and Python 3.12 with about 15 separate projects and 8 common library modules shared among them. Below is an outline of the directory structure I'm currently using. Each module folder has an init.py file with a list of the .py files in the folder.

    Python
    |
    |- Common
    | |
    | |- module1
    | |- module2
    |- Project1
    |- Project2


    I have 2 questions:

    1. Is this the best approach to organizing my code? I'm relatively new to VS Code and Python.
    2. How is this even working? I have projects that have "from Common import module1 as m1" statements that actually work, but when I create a new project and try the same statement it report "No module named Common"

    Relatively inexperienced here so would appreciate any guidance.

    Continue reading...

Compartilhe esta Página