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

2006-12-01 Thread Tony Cappellini
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 fi

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

2006-12-01 Thread Alan Gauld
"Tony Cappellini" <[EMAIL PROTECTED]> wrote > 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 For complex GUIs this can be quite difficult since GUIs are essentially stateless and command li

Re: [Tutor] Rounding a float to n significant digits

2006-12-01 Thread Dick Moores
At 09:20 PM 11/30/2006, Tim Peters wrote: >[Dick Moores] >>... >>But isn't there a PRECISE answer to my question? > >Of course ;-) > >>Or is it OT? > >Well, it's really more a question about your machine's floating-point >hardware than about Python. Good explanations of exact limits for >IEEE-754

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-12-01 Thread Tor Hildrum
On 11/30/06, John Fouhy <[EMAIL PROTECTED]> wrote: > For the same reason that dictionaries don't preserve order. > Basically, sets are (I think) implemented using a hash table. You can > read about hash tables on wikipedia (or many other places), but one of > the components of a hash table is a f

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-12-01 Thread Chris Hengge
Ok, well... I think people lost the scope of my question.. I'm happy using the first method that was given to my post, I have stated in two emails that the order doesn't matter.. What I asked was why the order was changed, or more directly, what is the command actually doing to my data? I'm sure

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-12-01 Thread Chris Hengge
Somewhat less sarcastic... I did omg find that answer, and I didn't feel like this was such a unique thing to do that I needed to re-invent the wheel by building several methods to do something that a common library should already have. On 11/30/06, Jordan Greenberg <[EMAIL PROTECTED]> wrote: C

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-12-01 Thread Python
On Fri, 2006-12-01 at 11:58 -0800, Chris Hengge wrote: > Ok, well... I think people lost the scope of my question.. I'm happy > using the first method that was given to my post, I have stated in two > emails that the order doesn't matter.. > > What I asked was why the order was changed, or more d

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

2006-12-01 Thread Dave Kuhlman
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

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

2006-12-01 Thread Chris Hengge
I'm wondering if this (snipped from another poster) 1. Look at module cmd in the Python standard library if you have not already. (see http://docs.python.org/lib/module-cmd.html) would be used for something like a built in console found in alot of games? On 12/1/06, Tony Cappellini <[EMAIL PR

[Tutor] which file runs

2006-12-01 Thread johnf
Hi, if there is a pyc and a py file within a module and the py file has a later date which file will python run? John -- John Fabiani ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] which file runs

2006-12-01 Thread Chris Hengge
My understanding is that whenever you run a script that has a newer.py, the .py runs, otherwise it automagically will use the .pyc On 12/1/06, johnf <[EMAIL PROTECTED]> wrote: Hi, if there is a pyc and a py file within a module and the py file has a later date which file will python run? John

Re: [Tutor] which file runs

2006-12-01 Thread Christopher Arndt
Chris Hengge schrieb: > My understanding is that whenever you run a script that has a newer.py, > the .py runs, otherwise it automagically will use the .pyc Not exactly. Whenever there is a .py file and no .pyc file is present or the .pyc file is older, Python will read the .py file, compile it in

Re: [Tutor] which file runs

2006-12-01 Thread Christopher Arndt
Addendum: these rules only apply to Python *modules*. AFAIK, when you call a Python file as a script, no matching .pyc/.pyo file is used or generated. There are some clever tricks to run a .pyc file as a script. I think it is described in the Python CGI FAQ. Chris