Re: Custom Classes?

2008-05-15 Thread Victor Subervi
Well, you are right. It looks like one of those instances where I fixed something and did not check to see if it influenced the problem now at hand. Thanks again. Victor On 5/15/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Tue, 13 May 2008 15:10:21 -0300, Victor Subervi < > [EMAIL PROT

Re: Custom Classes?

2008-05-15 Thread Gabriel Genellina
En Tue, 13 May 2008 15:10:21 -0300, Victor Subervi <[EMAIL PROTECTED]> escribió: I remember why I had the number with the getpic. It is because I display several of these images on a single page, and apparently I cannot call the same script and get more than one image from an HTML page. T

Re: Custom Classes?

2008-05-13 Thread Victor Subervi
I remember why I had the number with the getpic. It is because I display several of these images on a single page, and apparently I cannot call the same script and get more than one image from an HTML page. Victor On Fri, May 9, 2008 at 10:26 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En

Re: Custom Classes?

2008-05-13 Thread Victor Subervi
On 5/9/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Thu, 08 May 2008 12:33:55 -0300, Victor Subervi < > [EMAIL PROTECTED]> escribió: > > Okay, trying this again with everything working and no ValueError or any > > other errors, here we go: > > > > getpic = "getpic" + str(w) + ".py" > > >

Dynamic generation of images (was Re: Custom Classes?)

2008-05-09 Thread J. Cliff Dyer
On Thu, 2008-05-08 at 10:33 -0500, Victor Subervi wrote: > Okay, trying this again with everything working and no ValueError or > any other errors, here we go: > > Load this code. Unless you use a similar login() script, you will want > to edit your own values into the user, passwd, db and host: >

Re: Custom Classes?

2008-05-08 Thread Gabriel Genellina
En Thu, 08 May 2008 12:33:55 -0300, Victor Subervi <[EMAIL PROTECTED]> escribió: Okay, trying this again with everything working and no ValueError or any other errors, here we go: getpic = "getpic" + str(w) + ".py" Why do you *generate* the getpicNN.py? It contains always the same code,

Re: Custom Classes?

2008-05-08 Thread Victor Subervi
Okay, trying this again with everything working and no ValueError or any other errors, here we go: Load this code. Unless you use a similar login() script, you will want to edit your own values into the user, passwd, db and host: #!/usr/bin/python import MySQLdb import sys,os sys.path.append(os

Re: Custom Classes?

2008-05-02 Thread Victor Subervi
Thank you for your patience. I apologize for so many errors. Also, apparently your email client renders those double-spaces whereas mine does not. Hopefully the below is better: #!/usr/bin/python import MySQLdb import sys,os sys.path.append(os.getcwd()) from login import login user, passwd, db, h

Re: Custom Classes?

2008-05-02 Thread J. Clifford Dyer
On Thu, 2008-05-01 at 17:31 -0500, Victor Subervi wrote: > On Wed, Apr 30, 2008 at 12:35 PM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > Post working code, and I'll answer your actual question. > > Good grief! The code is *not* double spaced! Take a look. Click to > the end of the first li

Re: Custom Classes?

2008-05-01 Thread Victor Subervi
On Wed, Apr 30, 2008 at 12:35 PM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > Post working code, and I'll answer your actual question. Good grief! The code is *not* double spaced! Take a look. Click to the end of the first line and hit the right arrow key, and see for yourself. As for not initi

Re: Custom Classes?

2008-04-30 Thread J. Cliff Dyer
o responses. Is this only possible with custom classes? Please, give > me some guidance here! > try: > > w += 1 > > getpic = "getpic" + str(w) + ".py" > > try: > > os.remove(getpic) > > except: > > pass > > co

Custom Classes?

2008-04-30 Thread Victor Subervi
Hi; I have the following code which produces a file every time I need to display an image from MySQL. What garbage! Surely, python is capable of better than this, but the last time I asked for help on it, I got no responses. Is this only possible with custom classes? Please, give me some guidance

Re: custom classes in sets

2005-02-14 Thread Fredrik Lundh
John Machin wrote: > Then before you rush and implement something, google around and look in > the Tools and Scripts directories in the Python distribution; I'm quite > sure I've seen something like a "duplicate file detector" written in > Python somewhere. first google hit: http://sebsauvag

Re: custom classes in sets

2005-02-14 Thread John Machin
vegetax wrote: > How can i make my custom class an element of a set? > > the idea is that it accepts file paths and construct a set of unique > files (the command "cmp" compares files byte by byte.),the files can > have different paths but the same content > Q: How do I transport ten sumo wrestle

Re: custom classes in sets

2005-02-14 Thread Carl Banks
vegetax wrote: > Steven Bethard wrote: > > > vegetax wrote: > >> How can i make my custom class an element of a set? > >> > >> class Cfile: > >> def __init__(s,path): s.path = path > >> > >> def __eq__(s,other): > >>print 'inside equals' > >>return not os.popen('cmp %s %s' % (s.path,oth

Re: custom classes in sets

2005-02-14 Thread Nick Coghlan
vegetax wrote: How can i make my custom class an element of a set? class Cfile: def __init__(s,path): s.path = path def __eq__(s,other): print 'inside equals' return not os.popen('cmp %s %s' % (s.path,other.path)).read() def __hashcode__(s): return s.path.__hashcode__() the idea is that

Re: custom classes in sets

2005-02-14 Thread vegetax
Steven Bethard wrote: > vegetax wrote: >> How can i make my custom class an element of a set? >> >> class Cfile: >> def __init__(s,path): s.path = path >> >> def __eq__(s,other): >>print 'inside equals' >>return not os.popen('cmp %s %s' % (s.path,other.path)).read() >> >> def __ha

Re: custom classes in sets

2005-02-13 Thread Steven Bethard
vegetax wrote: How can i make my custom class an element of a set? class Cfile: def __init__(s,path): s.path = path def __eq__(s,other): print 'inside equals' return not os.popen('cmp %s %s' % (s.path,other.path)).read() def __hashcode__(s): return s.path.__hashcode__() the idea is that

RE: custom classes in sets

2005-02-13 Thread vegetax
Delaney, Timothy C (Timothy) wrote: > vegetax wrote: > >> def __hashcode__(s): return s.path.__hashcode__() > > Try __hash__ ... > > Tim Delaney sorry about the typo, it is indead __hash__() that i tried -- http://mail.python.org/mailman/listinfo/python-list

RE: custom classes in sets

2005-02-13 Thread Delaney, Timothy C (Timothy)
vegetax wrote: > def __hashcode__(s): return s.path.__hashcode__() Try __hash__ ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

custom classes in sets

2005-02-13 Thread vegetax
How can i make my custom class an element of a set? class Cfile: def __init__(s,path): s.path = path def __eq__(s,other): print 'inside equals' return not os.popen('cmp %s %s' % (s.path,other.path)).read() def __hashcode__(s): return s.path.__hashcode__() the idea is that it accepts