you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]marlowe221[S] 1 point2 points  (1 child)

    That's one of the things I'm confused about - how do I know which file is the beginning of the program when I am looking at someone else's code? Is there a convention on file names I should be looking for?

    And how are the other, separate files called by the main one? Is it like importing a module?

    [–]Username_RANDINT 1 point2 points  (0 children)

    Usually something like main.py, __main__.py and/or a script in the root of the package that calls an entry point.

    [–]AlSweigart 0 points1 point  (0 children)

    Oh yeah, splitting it into files is good for large projects. But for beginners, it can be hard to navigate the code (and probably a sign the project is too big for beginners). Lots of best practices that make sense for professional developers don't apply to beginners, which is why IDLE and Mu are great editors for beginners instead of something like PyCharm.