[Tutor] How To structure a program for cmd line mode & gui mode

Dave Kuhlman dkuhlman at rexx.com
Fri Dec 1 22:21:37 CET 2006


On Fri, Dec 01, 2006 at 12:21:33AM -0800, Tony Cappellini wrote:
> I"m writing a cmd line program which will automate getting some modules out
> of cvs, based on some
> input criteria.
> 
> Initiallly, I will do a cmd line version, but would like to make a gui
> version later with QT.
> 
> I would like to find out how to structure the program so that when the gui
> version is finised, it will still be fully functional in cmd line mode
> (without gui).

Suggestions:

1. Look at module cmd in the Python standard library if you have
   not already.  (see http://docs.python.org/lib/module-cmd.html)

2. In your code, separate functionality from interface (GUI).  Your
   goal should be to be able to use the functions (or classes) that
   implement function in both the command line code and the GUI
   code.

Dave

[snip]


-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman


More information about the Tutor mailing list