Re: importing csv file into sqlite

2008-12-18 Thread Chris Rebert
On Wed, Dec 17, 2008 at 11:20 PM, klia wrote: > klia wrote: >> >> hey guys, i have a hug .csv file which i need to insert it into sqlite >> database using python. >> my csv data looks like this >> Birthday2,12/5/2008,HTC,this is my birthday >> Sea,12/3/2008,kodak,sea >> birthday4,14/3/2009,samsung

Re: importing csv file into sqlite

2008-12-18 Thread James Mills
@klia: You could have had this done hours ago had you taken my suggestion, used my tool and just piped it into sqlite3 on the command line. --JamesMills -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: importing csv file into sqlite

2008-12-18 Thread Peter Otten
Chris Rebert wrote: >> klia wrote: >> for item in input: >>curse.execute('INSERT INTO photos VALUES (?,?,?,?)',item) > I believe you need to change 'item' to '*item' to expand the list in > the call so that the function gets 4 additional args rather than 1 > additional arg that happens t

Re: socket and subprocess problem

2008-12-18 Thread Bryan Olson
James Mills wrote: subprocess process: #1. When my subprocess process has successfully started notify the parent. #2. When my subprocess process has successfully created a listening socket, notify the parent. parent process: #1. When our subprocess process has successfully

Re: socket and subprocess problem

2008-12-18 Thread James Mills
On Thu, Dec 18, 2008 at 8:00 PM, Bryan Olson wrote: > I'd swear James copied my response, except his came first. Even the > formatting came out similar. I hadn't seen his response when I wrote mine, > and wouldn't have bothered posing the same thing again. Great minds think alike huh :) You shoul

Re: OT: Binary tree logarithms properties

2008-12-18 Thread Mr . SpOOn
2008/12/17 Terry Reedy : > Nodes only have single number indexes if you arrange them linearly. Then the > index depends on how you arrange them, whether you start the array indexes > with 0 or 1, and whether you start the level numbers with 0 or 1. Call the > breadth-first sequence bf. Then the 1

Re: cx_Oracle issues

2008-12-18 Thread huw_at1
On Dec 16, 12:17 pm, huw_at1 wrote: > On Dec 15, 12:59 pm, "[email protected]" > wrote: > > > > > On Dec 15, 2:44 am, huw_at1 wrote: > > > > On Dec 11, 5:34 pm, "[email protected]" wrote: > > > > > On Dec 10, 9:48 am, huw_at1 wrote: > > > > > > Hey all. When usingcx_Oracleto run a procedur

Re: subprocess.Popen inheriting

2008-12-18 Thread Aaron Brady
On Dec 17, 7:16 pm, "Gabriel Genellina" wrote: > En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady   > escribió: > > > > > On Dec 17, 5:05 pm, "Gabriel Genellina" > > wrote: > >> En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders   > >> escribió: > > >> > It would be nice if Python created pipes

Best Practice using Glade/Python

2008-12-18 Thread eric
Hi, I was wondering which is the "best practice" using glade/python, and, of course, especially the connect (both side). I didn't found that much documentation on the net ( too noisy), and the best "thing" I've found was http://www.linuxjournal.com/article/7558 which is a bit old now (2004). The

Re: OT: Binary tree logarithms properties

2008-12-18 Thread Aaron Brady
On Dec 18, 4:34 am, Mr.SpOOn wrote: > 2008/12/17 Terry Reedy : > > > Nodes only have single number indexes if you arrange them linearly. Then the > > index depends on how you arrange them, whether you start the array indexes > > with 0 or 1, and whether you start the level numbers with 0 or 1.  Ca

Re: C API and memory allocation

2008-12-18 Thread Ivan Illarionov
On 18 дек, 03:51, Aaron Brady wrote: (snip) > How did you get a reference to the original > string object, with which to increment its reference count? Use the "O!" format instead of "s": PyObject *pystr; ... PyArg_ParseTuple(args, "O!", &PyStringObject, &pystr) ... Then you can use PyString_AS

Re: C API and memory allocation

2008-12-18 Thread Ivan Illarionov
On 18 дек, 14:09, Ivan Illarionov wrote: > ... PyArg_ParseTuple(args, "O!", &PyStringObject, &pystr) ... Sorry, I must have said &PyString_Type, not &PyStringObject -- http://mail.python.org/mailman/listinfo/python-list

Re: [Help] The pywinauto Can't select the MDI's menu using the MenuItems() which return [].

2008-12-18 Thread 为爱而生
This problem also use the following discription:How to use pywinauto to open WORD and select its Menu. I can't do that and have no idea why! Looking forward your help,Thanks! 2008/12/17 为爱而生 > I can't use the MenuItems() in my MDI application. > Any example is very nice Thanks a lot! > > -

Re: importing csv file into sqlite

2008-12-18 Thread John Machin
On Dec 18, 6:20 pm, klia wrote: > klia wrote: > > > hey guys, i have a hug .csv file which i need to insert it into sqlite > > database using python. > > my csv data looks like this > > Birthday2,12/5/2008,HTC,this is my birthday > > Sea,12/3/2008,kodak,sea > > birthday4,14/3/2009,samsung,birthday

Re: Selecting a different superclass

2008-12-18 Thread [email protected]
On 17 Dec, 20:33, "Chris Rebert" wrote: > superclass = TraceablePointSet if tracing else PointSet > Perfect - many thanks. Good to know I'm absolved from evil, also ;) Peter -- http://mail.python.org/mailman/listinfo/python-list

www.webhizmetlerim.com

2008-12-18 Thread sevimli arkadaş
Dear Readers; If you write us our web site's queue and page number at google then three of you can get prices from us.We are going to have a sweepstake for this. If you send more mails,you have more chance to win. Our competition is going to finish at 1 February 2009. Please write google 'web tasar

Re: C API and memory allocation

2008-12-18 Thread Aaron Brady
On Dec 18, 5:09 am, Ivan Illarionov wrote: > On 18 ÄÅË, 03:51, Aaron Brady wrote: > (snip) > > > How did you get a reference to the original > > string object, with which to increment its reference count? > > Use the "O!" format  instead of "s": > PyObject *pystr; > ... PyArg_ParseTuple(args, "O!

Re: help I'm getting delimited

2008-12-18 Thread aka
On 18 dec, 00:06, John Machin wrote: > On Dec 18, 3:15 am, aka wrote: > > Do you mean that this file was created by whatever.UnicodeWriter? If > so, did you just now discover this information? > > How do you know that "the UnicodeWriter is functioning perfectly"? > What does "functioning perfectl

Re: help I'm getting delimited

2008-12-18 Thread aka
On 18 dec, 00:06, John Machin wrote: - Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - > On Dec 18, 3:15 am, aka wrote: > Do you mean that this file was created by whatever.UnicodeWriter? If > so, did you just now discover this information? >

Re: help I'm getting delimited

2008-12-18 Thread aka
> On Dec 18, 3:15 am, aka wrote: > Do you mean that this file was created by whatever.UnicodeWriter? If > so, did you just now discover this information? > How do you know that "the UnicodeWriter is functioning perfectly"? > What does "functioning perfectly mean to you"? In particular, what > enco

Re: [Help] The pywinauto Can't select the MDI's menu using the MenuItems() which return [].

2008-12-18 Thread Simon Brunning
2008/12/18 为爱而生 : > This problem also use the following discription: > How to use pywinauto to open WORD and select its Menu. > I can't do that and have no idea why! > Looking forward your help,Thanks! Word can be automated with COM. My golden rule is that automation via GUI driving is always a la

re.match() performance

2008-12-18 Thread Emanuele D'Arrigo
Hi everybody! I've written the code below to test the differences in performance between compiled and non-compiled regular expression matching but I don't quite understand the results. It appears that the performance difference is only around 2%, even if I run the import re import

re.match() performance

2008-12-18 Thread Emanuele D'Arrigo
Sorry for the previous post, hit the Enter button by mistake... here's the complete one: Hi everybody! I've written the code below to test the differences in performance between compiled and non-compiled regular expression matching but I don't quite understand the results. It appears that the com

Re: C API and memory allocation

2008-12-18 Thread Stefan Behnel
Aaron Brady wrote: > I see. Do I read correctly that 's' is only useful when the > argument's position is known? I assume you meant "length". > Otherwise you can't know its length or > change its reference count. The internal representation of Python byte strings is 0 terminated, so strlen()

Re: something else instead of PIL?

2008-12-18 Thread imageguy
On Dec 17, 3:48 pm, Reimar Bauer wrote: > Hi > > what has happened to PIL? No updates since two years. > > Or does one know an alternative lib for resizing images? > > cheers > Reimar I have found the FreeImage library with the Python bindings quite workable. I work with multi-page TIF images and

confused about __str__ vs. __repr__

2008-12-18 Thread Neal Becker
Reading some FAQ, I see that __str__ is "meant for human eyes". But it seems that: class X(object): def __str__(self): return "str" def __repr__(self): return "repr" x = X() d = {0 : x} print d {0: repr} So if __str__ is "meant for human eyes", then why isn't print using

Re: something else instead of PIL?

2008-12-18 Thread Reimar Bauer
[email protected] schrieb: > Reimar> Hi what has happened to PIL? No updates since two years. > > It's well-written, stable code. As far as I know it does what people want > (at least it's done everything I've needed when I've used it). Why should > it matter that there hasn't been an official

Re: something else instead of PIL?

2008-12-18 Thread Reimar Bauer
imageguy schrieb: > On Dec 17, 3:48 pm, Reimar Bauer wrote: >> Hi >> >> what has happened to PIL? No updates since two years. >> >> Or does one know an alternative lib for resizing images? >> >> cheers >> Reimar > > I have found the FreeImage library with the Python bindings quite > workable. I w

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Tino Wildenhain
Neal Becker wrote: Reading some FAQ, I see that __str__ is "meant for human eyes". But it seems that: class X(object): def __str__(self): return "str" def __repr__(self): return "repr" x = X() d = {0 : x} print d {0: repr} So if __str__ is "meant for human eyes", then w

Re: re.match() performance

2008-12-18 Thread MRAB
Emanuele D'Arrigo wrote: Sorry for the previous post, hit the Enter button by mistake... here's the complete one: Hi everybody! I've written the code below to test the differences in performance between compiled and non-compiled regular expression matching but I don't quite understand the resul

Re: C API and memory allocation

2008-12-18 Thread MRAB
Stefan Behnel wrote: Aaron Brady wrote: I see. Do I read correctly that 's' is only useful when the argument's position is known? I assume you meant "length". Otherwise you can't know its length or change its reference count. The internal representation of Python byte strings is 0 termi

Re: re.match() performance

2008-12-18 Thread Diez B. Roggisch
Emanuele D'Arrigo wrote: > Sorry for the previous post, hit the Enter button by mistake... here's > the complete one: > > Hi everybody! > > I've written the code below to test the differences in performance > between compiled and non-compiled regular expression matching but I > don't quite under

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Neal Becker
Tino Wildenhain wrote: > Neal Becker wrote: >> Reading some FAQ, I see that __str__ is "meant for human eyes". >> >> But it seems that: >> class X(object): >> def __str__(self): >> return "str" >> def __repr__(self): >> return "repr" >> >> x = X() >> d = {0 : x} >> print

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Diez B. Roggisch
Neal Becker wrote: > Reading some FAQ, I see that __str__ is "meant for human eyes". > > But it seems that: > class X(object): >     def __str__(self): >         return "str" >     def __repr__(self): >         return "repr" > > x = X() > d = {0 : x} > print d > {0: repr} > > So if __str__ is "

Re: re.match() performance

2008-12-18 Thread Pierre-Alain Dorange
Emanuele D'Arrigo wrote: > I've written the code below to test the differences in performance > between compiled and non-compiled regular expression matching but I > don't quite understand the results. It appears that the compiled the > pattern only takes 2% less time to process the match. Is the

Re: re.match() performance

2008-12-18 Thread Peter Otten
Emanuele D'Arrigo wrote: > I've written the code below to test the differences in performance > between compiled and non-compiled regular expression matching but I > don't quite understand the results. It appears that the compiled the > pattern only takes 2% less time to process the match. Is ther

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Tino Wildenhain
Neal Becker wrote: ... So if __str__ is "meant for human eyes", then why isn't print using it! it is: > print x str but dict just uses repr() for all its childs to print. T. That makes no sense to me. If I call 'print' on a container, why wouldn't it recursively print on the contained ob

Minor Typo in doc

2008-12-18 Thread Kurt Mueller
Hi There is a minor typo in the new doc in: http://www.python.org/doc/2.6/library/signal.html -- signal.SIG_DFL¶ This is one of two standard signal handling options; it will simply perform the default function for the signa

Re: C API and memory allocation

2008-12-18 Thread Floris Bruynooghe
On Dec 18, 6:43 am, Stefan Behnel wrote: > Floris Bruynooghe wrote: > > I'm slightly confused about some memory allocations in the C API. > > If you want to reduce the number of things you have to get your head > around, learn Cython instead of the raw C-API. It's basically Python, does > all the

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Neal Becker
Tino Wildenhain wrote: > Neal Becker wrote: > ... So if __str__ is "meant for human eyes", then why isn't print using it! >>> it is: >>> >>> > print x >>> str >>> >>> but dict just uses repr() for all its childs to print. >>> >>> T. >> That makes no sense to me. If I call 'print' on a conta

Re: something else instead of PIL?

2008-12-18 Thread skip
Reimar> I am interested to get some new features added e.g. some special Reimar> conversion routines for colorblind people. Reimar> http://scien.stanford.edu/class/psych221/projects/05/ofidaner/colorblindness_project.htm Reimar> How can that be archieved? Contact Fredrik Lundh?

Re: help I'm getting delimited

2008-12-18 Thread J. Cliff Dyer
On Wed, 2008-12-17 at 06:28 -0800, aka wrote: > Hi John, thanks. > You're right, I didn't past the method header because I thought it > didn't matter when the input filename is hardcoded. > The try/except isn't very helpful indeed so I commented it out. > You're right I wrongly referred to the Uni

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Jean-Paul Calderone
On Thu, 18 Dec 2008 09:51:01 -0500, Neal Becker wrote: Tino Wildenhain wrote: Neal Becker wrote: ... So if __str__ is "meant for human eyes", then why isn't print using it! it is: > print x str but dict just uses repr() for all its childs to print. T. That makes no sense to me. If I ca

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Diez B. Roggisch
Neal Becker wrote: > Tino Wildenhain wrote: > >> Neal Becker wrote: >> ... > So if __str__ is "meant for human eyes", then why isn't print using > it! it is: > print x str but dict just uses repr() for all its childs to print. T. >>> That makes no

Re: Selecting a different superclass

2008-12-18 Thread Jason
On Dec 18, 4:36 am, "[email protected]" wrote: > On 17 Dec, 20:33, "Chris Rebert" wrote: > > > superclass = TraceablePointSet if tracing else PointSet > > Perfect - many thanks. Good to know I'm absolved from evil, also ;) > > Peter Another way would be to have a factory function that buil

Re: Minor Typo in doc

2008-12-18 Thread Steve Holden
Kurt Mueller wrote: > Hi > > > > There is a minor typo in the new doc in: > http://www.python.org/doc/2.6/library/signal.html > > -- > signal.SIG_DFL¶ > This is one of two standard signal handling options; > it will simply

Extracting data from XML containing CDATA and store data in a .dbf file

2008-12-18 Thread David Shi
I am looking for advice/efficient script to extract data from XML containing CDATA.   I wish to extract all the data and store it in a .dbf file.   Regards.   David -- http://mail.python.org/mailman/listinfo/python-list

psycopg2 and large queries

2008-12-18 Thread Laszlo Nagy
psycopg2 is said to be db api 2.0 compilant, but apparent it is buggy. By default, when I create a cursor with cur = conn.cursor() then it creates a cursor that will fetch all rows into memory, even if you call cur.fetchone() on it. (I tested it, see below.) I was looking for psycopg2 documenta

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Neal Becker
Diez B. Roggisch wrote: > Neal Becker wrote: > >> Tino Wildenhain wrote: >> >>> Neal Becker wrote: >>> ... >> So if __str__ is "meant for human eyes", then why isn't print using >> it! > it is: > > > print x > str > > but dict just uses repr() for all its childs

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Diez B. Roggisch
Neal Becker wrote: > Diez B. Roggisch wrote: > >> Neal Becker wrote: >> >>> Tino Wildenhain wrote: >>> Neal Becker wrote: ... >>> So if __str__ is "meant for human eyes", then why isn't print using >>> it! >> it is: >> >> > print x >> str >> >> but dic

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Mikael Olofsson
Diez B. Roggisch wrote: Yep. And it's easy enough if you don't care about them being different.. def __repr__(self): return str(self) If I ever wanted __str__ and __repr__ to return the same thing, I would make them equal: def __str__(self): return 'whatever you want' __repr__ = __s

Is this pythonic?

2008-12-18 Thread ipytest
x.validate_output(x.find_text(x.match_filename (x.determine_filename_pattern(datetime.datetime.now() Is it even good programming form? -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about __str__ vs. __repr__

2008-12-18 Thread rdmurray
Quoth "Diez B. Roggisch" : > Neal Becker wrote: > > > Tino Wildenhain wrote: > > > >> Neal Becker wrote: > >> ... > >>> That makes no sense to me. If I call 'print' on a container, why > >>> wouldn't it recursively print on the contained objects? Since print > >>> means call str, printing a co

Re: Is this pythonic?

2008-12-18 Thread Bruno Desthuilliers
[email protected] a écrit : x.validate_output(x.find_text(x.match_filename (x.determine_filename_pattern(datetime.datetime.now() Is it even good programming form? functional programming addicts might say yes. But as far as I'm concerned, I find it a bit too nested... -- http://mail.pytho

mysql with python

2008-12-18 Thread manojghimire
can anybody give me the link where I can directly download the _mysql.dll file required by MySQLdb for Python 2.6. I tried to build MySQL db but there is error: None. Is there a need for me to step down to Python 2.5 ?? Further any comments on the best ORM for Python ?? -- http://mail.python.org/m

Tkinter unbinding

2008-12-18 Thread Roger
I've done a lot of googling for this topic and I fear that it's not possible. I have a widget that is overloaded with several bindings. I want to be able to unbind one method form the same Event without destroying all the other bindings to the same event that's associated to the same widget. For

Re: Tkinter unbinding

2008-12-18 Thread r
w.unbind ( sequence, funcid=None ) This method deletes bindings on w for the event described by sequence. If the second argument is a callback bound to that sequence, that callback is removed and the rest, if any, are left in place. If the second argument is omitted, all bindings are deleted. see

Re: Tkinter unbinding

2008-12-18 Thread Roger
>funcid1 = root.bind("<1>", lambda e: test()) >funcid2 = root.bind("<1>", lambda e: test2(), add='+') >root.unbind("<1>", funcid2) Isn't this what I've done in my example code? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this pythonic?

2008-12-18 Thread Laszlo Nagy
[email protected] wrote: x.validate_output(x.find_text(x.match_filename (x.determine_filename_pattern(datetime.datetime.now() Is it even good programming form? You should try LISP. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter unbinding

2008-12-18 Thread r
Yea, my answer was really not a helping answer(sorry) just showing exactly why this will not work with w.unbind(). Why do you need two separate functions to bind the same event?? You cannot combine the two?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this pythonic?

2008-12-18 Thread pruebauno
On Dec 18, 11:08 am, [email protected] wrote: > x.validate_output(x.find_text(x.match_filename > (x.determine_filename_pattern(datetime.datetime.now() > > Is it even good programming form? Lisp and Scheme programmers love that style. You can tell by the number of parentheses :-). In Python peo

Re: Tkinter unbinding

2008-12-18 Thread Roger
On Dec 18, 11:40 am, r wrote: > Yea, my answer was really not a helping answer(sorry) just showing > exactly why this will not work with w.unbind(). Why do you need two > separate functions to bind the same event?? You cannot combine the > two?? I can't combine the two in my app unfortunately. T

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Mel
Neal Becker wrote: > Tino Wildenhain wrote: > >> Neal Becker wrote: >>> Reading some FAQ, I see that __str__ is "meant for human eyes". >>> >>> But it seems that: >>> class X(object): >>> def __str__(self): >>> return "str" >>> def __repr__(self): >>> return "repr" >>> >

Re: Location HTTP Header

2008-12-18 Thread ptn
On Dec 17, 6:47 pm, "Gabriel Genellina" wrote: > En Wed, 17 Dec 2008 20:52:42 -0200, ptn escribió: > > > I tried this stupid script on my server: > > >    #! /usr/bin/env python > > >    print 'Location:http://www.google.com\n' > > > and it didn't work, I get a blank page.  I first tried the Loca

Re: psycopg2 and large queries

2008-12-18 Thread Paul Boddie
On 18 Des, 16:34, Laszlo Nagy wrote: > psycopg2 is said to be db api 2.0 compilant, but apparent it is buggy. > By default, when I create a cursor with > > cur = conn.cursor() > > then it creates a cursor that will fetch all rows into memory, even if > you call cur.fetchone() on it. (I tested it,

Re: Tkinter unbinding

2008-12-18 Thread r
Maybe someone will chime in with an answer, sorry i could not help. ponder this, i must... -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2 and large queries

2008-12-18 Thread Steve Holden
Paul Boddie wrote: [...]> > You really don't want to be traversing large data sets using fetchone, > anyway. My approach (using pyPgSQL) involves fetchmany and then > looping over each batch of results, if I really have to process the > data in Python; most of the time I can do the processing in t

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Neal Becker
Mel wrote: > Neal Becker wrote: > >> Tino Wildenhain wrote: >> >>> Neal Becker wrote: Reading some FAQ, I see that __str__ is "meant for human eyes". But it seems that: class X(object): def __str__(self): return "str" def __repr__(self):

Adjusting filename and line number

2008-12-18 Thread banshee . welton
Hello, I'm working with some embedded python and would like to be able to adjust the reported filename and line number of some embedded user- written code so that errors returned coincide with things the user might actually be familiar with. In perl I could do this by adjusting the filename a

Re: Is this pythonic?

2008-12-18 Thread Jason Scheirer
On Dec 18, 8:45 am, [email protected] wrote: > On Dec 18, 11:08 am, [email protected] wrote: > > > x.validate_output(x.find_text(x.match_filename > > (x.determine_filename_pattern(datetime.datetime.now() > > > Is it even good programming form? > > Lisp and Scheme programmers love that sty

how to dock another application under Linux ?

2008-12-18 Thread Stef Mientki
hello, Under windows it's fairly easy to capture an application and dock in to your own wxPython application, something like this: - start the external application from within wxPython - give the caption of the application a special name - find de windows handler of the applications mainform - te

Re: Tkinter unbinding

2008-12-18 Thread Roger
On Dec 18, 12:49 pm, r wrote: > Maybe someone will chime in with an answer, sorry i could not help. > ponder this, i must... Regardless, thanks for your help! I truly appreciate it. Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter unbinding

2008-12-18 Thread Roger
On Dec 18, 12:49 pm, r wrote: > Maybe someone will chime in with an answer, sorry i could not help. > ponder this, i must... Regardless, thanks for your help! I truly appreciate it. Roger. -- http://mail.python.org/mailman/listinfo/python-list

IDLE cursor color

2008-12-18 Thread Vicent Giner
I am working with IDLE, version 1.2.2 I've changed the colors theme using the "Options > Configure IDLE..." menu option. I've chosen a black background for all the items, so now my work area is black, and everything is OK, except for the fact that I can't see where the cursor is located, I mean,

Re: Location HTTP Header

2008-12-18 Thread Mohamed Yousef
use LiveHTTPHeaders with firefox and show us browser-server interaction -- http://mail.python.org/mailman/listinfo/python-list

Factoring Polynomials

2008-12-18 Thread collin . day . 0
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 into python. Any ideas? -- http://mail.python.org/mailman/l

Re: Tkinter unbinding

2008-12-18 Thread Roger
On Dec 18, 12:49 pm, r wrote: > Maybe someone will chime in with an answer, sorry i could not help. > ponder this, i must... Regardless, thanks for your help! I truly appreciate it. Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter unbinding

2008-12-18 Thread Roger
On Dec 18, 12:49 pm, r wrote: > Maybe someone will chime in with an answer, sorry i could not help. > ponder this, i must... Regardless, thanks for your help! I truly appreciate it. Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE cursor color

2008-12-18 Thread r
in IDLE go to: Options -> Configure IDLE -> Highlighting... 1.) in the box click the word "cursor" 2.) press the button that says "Choose Color for" 3.) Pick a color and save the changes viola! you did it! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Factoring Polynomials

2008-12-18 Thread eric
On Dec 18, 8:37 pm, [email protected] 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: IDLE cursor color

2008-12-18 Thread Vicent Giner
On 18 dic, 20:52, r wrote: > in IDLE go to: > Options -> Configure IDLE -> Highlighting... > > 1.) in the box click the word "cursor" > 2.) press the button that says "Choose Color for" > 3.) Pick a color and save the changes > > viola! you did it! :) Thank you! I don't understand... I have trie

Re: Factoring Polynomials

2008-12-18 Thread Collin D
On Dec 18, 11:52 am, eric wrote: > On Dec 18, 8:37 pm, [email protected] 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

Re: IDLE cursor color

2008-12-18 Thread r
also try the python forum, great place for beginners... http://www.python-forum.org/pythonforum/index.php -- http://mail.python.org/mailman/listinfo/python-list

Re: Factoring Polynomials

2008-12-18 Thread J. Cliff Dyer
On Thu, 2008-12-18 at 11:52 -0800, eric wrote: > On Dec 18, 8:37 pm, [email protected] 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 qua

Re: Factoring Polynomials

2008-12-18 Thread Scott David Daniels
eric wrote: On Dec 18, 8:37 pm, [email protected] wrote: ... I dont know how to implement the quadratic equation ... with numpy: from numpy import * s=[1,-1] x = -b+s*sqrt( b**2-4*a*c )/(2*a) Numpy is pretty heavyweight for this. For built in modules you have a few choices: For real

Re: confused about __str__ vs. __repr__

2008-12-18 Thread J. Cliff Dyer
On Thu, 2008-12-18 at 13:35 -0500, Neal Becker wrote: > Mel wrote: > > > Neal Becker wrote: > > > >> Tino Wildenhain wrote: > >> > >>> Neal Becker wrote: > Reading some FAQ, I see that __str__ is "meant for human eyes". > > But it seems that: > class X(object): > d

Re: Factoring Polynomials

2008-12-18 Thread Mark Dickinson
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 __future__ import division, or use Python 3.0, or )

Re: psycopg2 and large queries

2008-12-18 Thread Paul Boddie
On 18 Des, 19:09, Steve Holden wrote: > > Hmm, pypgsql doesn't provide a 2.5 Windows installer. I take it you > aren't a Windows user ... ? Well, there are plenty of PostgreSQL modules around these days, and even if pyPgSQL isn't suitable, I'm sure that there must be one which can be made to work

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Robert Kern
Mikael Olofsson wrote: Diez B. Roggisch wrote: Yep. And it's easy enough if you don't care about them being different.. def __repr__(self): return str(self) If I ever wanted __str__ and __repr__ to return the same thing, I would make them equal: def __str__(self): return 'whatever

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Scott David Daniels
J. Cliff Dyer wrote: ... how an object prints itself is up to that object and that object alone If I wanted to implement a list-like class that doesn't show it's elements at > all when printed, but instead shows its length, I am free to do so. For example: hl = HiddenList(1,2,3) hl hl

Re: psycopg2 and large queries

2008-12-18 Thread Laszlo Nagy
Well, there are plenty of PostgreSQL modules around these days, and even if pyPgSQL isn't suitable, I'm sure that there must be one which can be made to work on Windows and to support server-side cursors. See here for more: http://wiki.python.org/moin/PostgreSQL I'm just looking for somethin

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Steve Holden
Neal Becker wrote: > Mel wrote: > >> Neal Becker wrote: >> >>> Tino Wildenhain wrote: >>> Neal Becker wrote: > Reading some FAQ, I see that __str__ is "meant for human eyes". > > But it seems that: > class X(object): > def __str__(self): > return "str"

Re: C API and memory allocation

2008-12-18 Thread Aaron Brady
On Dec 18, 7:54 am, Stefan Behnel wrote: > Aaron Brady wrote: > > I see.  Do I read correctly that 's' is only useful when the > > argument's position is known? > > I assume you meant "length". No, position in the argument list. Otherwise you can't change its reference count; in which case, a po

Re: Tkinter unbinding

2008-12-18 Thread r
On Dec 18, 1:48 pm, Roger wrote: > On Dec 18, 12:49 pm, r wrote: > > > Maybe someone will chime in with an answer, sorry i could not help. > > ponder this, i must... > > Regardless, thanks for your help! I truly appreciate it. > > Roger. 'no problema mi amigo!'.to_english(no problem my friend!)

Re: subprocess.Popen inheriting

2008-12-18 Thread Aaron Brady
On Dec 17, 7:16 pm, "Gabriel Genellina" wrote: > En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady   > escribió: > > > > > On Dec 17, 5:05 pm, "Gabriel Genellina" > > wrote: > >> En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders   > >> escribió: > > >> > It would be nice if Python created pipes

Re: psycopg2 and large queries

2008-12-18 Thread D'Arcy J.M. Cain
On Thu, 18 Dec 2008 22:28:23 +0100 Laszlo Nagy wrote: > - PyGresSQL: apparently, it does not support fetching one row, only > fetching all rows (see: > http://www.pygresql.org/pg.html#getresult-get-query-values-as-list-of-tuples), > > so this is not an option. (Yes, it also has a db api compil

Which sparse matrix package?

2008-12-18 Thread Martin Manns
Hi: I am writing a spreadsheet application in Python http://pyspread.sf.net which currently uses numpy.array for: + storing object references (each array element corresponds to one grid cell) + slicing (read and write) + mapping from/to smaller numpy.array + searching and replacing + growing

Re: Which sparse matrix package?

2008-12-18 Thread James Mills
On Fri, Dec 19, 2008 at 8:18 AM, Martin Manns wrote: > Hi: Hi, > I am writing a spreadsheet application in Python What's wrong with pyspread ? [ ... snip ... ] > The dict that I tried out is of the type: > > {(1,2,3): "2323", (1,2,545): "2324234", ... } > > It is too slow for my application w

Re: Factoring Polynomials

2008-12-18 Thread eric
On Dec 18, 9:40 pm, "J. Cliff Dyer" wrote: > On Thu, 2008-12-18 at 11:52 -0800, eric wrote: > > On Dec 18, 8:37 pm, [email protected] 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 > >

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 _

  1   2   >