Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modules
#4
I was wondering the same thing. The easiest thing to distribute is one file, but big files are hard to edit and maintain. Eventually you create some modules and import the module into your program. A module should have a well defined purpose, but depending on what you are doing that can result in rather large modules. You get tired of really big modules so your create sub-modules. To organize your sub-modules you create a directory structure.

It took me months to figure out how to organize my code so I could import my modules and my module inter-dependencies and unit tests and example snippets all work. Even though everything is working I have no confidence that I didn't make some really dumb choices and I'll have to reorganize everything once others start using my code. I have searched for anything that discusses this part of Python and there is not much there. Set your path. Use __import__.py files. Here is how you make a package. Good stuff, but more nuts and bolts than theory or practice.
Reply


Messages In This Thread
Modules - by menator01 - Apr-27-2020, 10:27 PM
RE: Modules - by Larz60+ - Apr-27-2020, 11:10 PM
RE: Modules - by menator01 - Apr-27-2020, 11:26 PM
RE: Modules - by deanhystad - Apr-28-2020, 01:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Modules issue, pip3 download modules only to pyhton3.5.2 not the latest 3.6.1 bmohanraj91 6 8,513 May-25-2017, 08:15 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020