Re: Command parsing... best module to use?

2009-11-03 Thread Collin D
Thanks for the replies. Pyparsing looks just like what I need. -- http://mail.python.org/mailman/listinfo/python-list

Command parsing... best module to use?

2009-11-02 Thread Collin D
Hey everyone. I am writing a game in python, and it includes a text console somewhat like the one in WoW and Runescape. I want to be able to include "/" commands, like IRC, and was wondering what the best module would be to parse these. Thanks a lot, Collin D -- http://mail.python.o

Re: Tkinter - problem closing window

2009-01-05 Thread Collin D
On Jan 5, 9:21 am, Roger wrote: > On Jan 5, 11:52 am, Collin D wrote: > > > > > On Jan 5, 6:25 am, "Djames Suhanko" wrote: > > > > Hello! > > > I'm sorry my terrible english (my native language is portuguese). > > > I has

Re: Tkinter - problem closing window

2009-01-05 Thread Collin D
On Jan 5, 6:25 am, "Djames Suhanko" wrote: > Hello! > I'm sorry my terrible english (my native language is portuguese). > I has a litle program that open another window. When I close de root > window in quit button, I need clicking 2 times to close. is where the > problem? > > The source: >   1 #!

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 6:41 pm, "Russ P." wrote: > On Dec 18, 6:31 pm, Collin D wrote: > > > > > > > On Dec 18, 6:27 pm, Collin D wrote: > > > > On Dec 18, 6:23 pm, "Russ P." wrote: > > > > > On Dec 18, 6:17 pm, Collin D wrote: >

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 6:27 pm, Collin D wrote: > On Dec 18, 6:23 pm, "Russ P." wrote: > > > > > > > On Dec 18, 6:17 pm, Collin D wrote: > > > > On Dec 18, 6:12 pm, Collin D wrote: > > > > > On Dec 18, 11:37 am, collin.da...@gmail.com wrote: &g

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 6:23 pm, "Russ P." wrote: > On Dec 18, 6:17 pm, Collin D wrote: > > > > > > > On Dec 18, 6:12 pm, Collin D wrote: > > > > On Dec 18, 11:37 am, collin.da...@gmail.com wrote: > > > > > I am trying to write a simple applicat

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 6:12 pm, Collin D wrote: > On Dec 18, 11:37 am, collin.da...@gmail.com wrote: > > > I am trying to write a simple application to factor polynomials. I > > wrote (simple) raw_input lines to collect the a, b, and c values from > > the user, but I dont know how to

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 11:37 am, collin.da...@gmail.com wrote: > I am trying to write a simple application to factor polynomials. I > wrote (simple) raw_input lines to collect the a, b, and c values from > the user, but I dont know how to implement the quadratic equation > > x = (-b +or- (b^2 - 4ac)^1/2) / 2a

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 5:10 pm, Steven D'Aprano wrote: > On Thu, 18 Dec 2008 11:37:35 -0800, collin.day.0 wrote: > > I am trying to write a simple application to factor polynomials. I wrote > > (simple) raw_input lines to collect the a, b, and c values from the > > user, but I dont know how to implement the q

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 5:30 pm, "James Mills" wrote: > UPDATE: > > jmi...@atomant:~/tmp$ cat polycalc.py > #!/usr/bin/env python > > from math import sqrt > > def f(a, b, c): >     if (b**2 - (4 * a * c)) < 0: >         return None, None # Can't solve >     x1 = -b - (sqrt(b**2 - (4 * a * c)) / (2 * a)) >    

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 4:41 pm, "James Mills" wrote: > On Fri, Dec 19, 2008 at 10:11 AM, Gabriel Genellina > > wrote: > > En Thu, 18 Dec 2008 17:37:35 -0200, escribió: > > >> I am trying to write a simple application to factor polynomials. I > >> wrote (simple) raw_input lines to collect the a, b, and c val

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 1:09 pm, Mark Dickinson wrote: > On Dec 18, 8:47 pm, Scott David Daniels wrote: > > >      else: # a single result (discriminant is zero) > >          return (-b / (2 * a),) > > Maybe make that (-b / (2. * a)) to avoid getting funny results > when a and b are integers.  (Or do a from _

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 11:52 am, eric wrote: > On Dec 18, 8:37 pm, collin.da...@gmail.com wrote: > > > I am trying to write a simple application to factor polynomials. I > > wrote (simple) raw_input lines to collect the a, b, and c values from > > the user, but I dont know how to implement the quadratic equat