Proper layout of python packages for a Graphical User Interface (GUI)

On the project I'm currently working on (a GUI for a testing system) I'm required to write base classes for all graphical objects and inherit these objects into the class which utilises the graphical object. The actual working code is then written there. This seems like standard procedure for these sort of GUI related projects.

My question is; with multiple graphical object base files, all inherited by functional modules, which are all executed by a mainframe module which is launched by a Launcher script, are there any recommended layouts for the file system containing these scripts.

I'm basically deciding between:

/mainfolder ---> __init__.py
                 launcher.py
                 /MainPackage ---> __init__.py
                                  Mainframe.py
                                  Subframe_1.py
                                  Subframe_2.py
                                  /Bases ------> __init__.py
                                                 Mainframe_base.py
                                                 Subframe_1_base.py
                                                 Subframe_2_base.py

or :

/mainfolder ---> __init__.py
                 launcher.py
                 /MainPackage ---> __init__.py
                                   /Mainframe    ---> __init__.py
                                                      Mainframe.py
                                                      Mainframe_base.py
                                   /Subframe_1.py --> __init__.py
                                                      Subframe_1.py
                                                      Subframe_1_base.py
                                   /Subframe_2.py --> __init__.py
                                                      Subframe_2.py
                                                      Subframe_2_base.py

Are either of these better than the other? Or is there another, more commonly used form of organising the modules?

Answers


I like to keep things modular, so would go with

/mainfolder --> __init__.py
                launcher.py
                /MainPackage --> __init__.py
                                 /Mainframe  --> __init__.py
                                                 Mainframe.py
                                                 Mainframe_base.py
                                 /Subframe_1 --> __init__.py
                                                 Subframe_1.py
                                                 Subframe_1_base.py
                                 /Subframe_2 --> __init__.py
                                                 Subframe_2.py
                                                 Subframe_2_base.py

if not just 1 .py per frame.


Need Your Help

oracle sql date not later than today

sql oracle logic

I need to display some data if it's a

bridging svn and git repos

git svn version-control git-svn

We've got two teams: internal team in the office behind a proxy using internal svn; external team out in the open internet using git and wanting to collaborate but not being able to access the inte...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.