Re: [pysqlite] [ANN] pysqlite and APSW projects moved

2008-03-13 Thread Gerhard Häring
Colin Mcphail wrote: > On 2008-03-09 18:57:00 +, Gerhard Häring <[EMAIL PROTECTED]> said: > > Gerhard Häring wrote: [...] APSW web:http://oss.itsystementwicklung.de/trac/apsw/ scm:Subversion: http://initd.org/svn/pysqlite/apsw/trunk/ > > That should have

Re: image matching algorithms

2008-03-13 Thread Yu-Xi Lim
Daniel Fetchinson wrote: > Since you seem to know quite a bit about this topic, what is your > opinion on the apparently 'generic' algorithm described here: > http://grail.cs.washington.edu/projects/query/ ? > So far it seems to me that it does what I'm asking for, it does even > more because it ca

getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Dave Kuhlman
The following code has me mystified: In [4]: class A(object): ...: def show(self): ...: print 'hello' ...: ...: In [5]: a = A() In [6]: In [7]: x = a.show In [8]: y = getattr(a, 'show') In [9]: x Out[9]: > In [10]: y Out[10]: > In [11]: In [12]: id(x) Out[12]: 12419552 In [

Spaces in path name

2008-03-13 Thread David S
Hi, I have some code in which I have to change some path names to get it to work. The original code seems to have assumed that path names would not have any embedded spaces. I am not sure how to write the following line so when used in my script the path will be found. ANT_CMD = r'C:\Program

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Imri Goldberg
Dave Kuhlman wrote: > The following code has me mystified: > > In [4]: class A(object): >...: def show(self): >...: print 'hello' >...: >...: > In [5]: a = A() > In [6]: > In [7]: x = a.show > In [8]: y = getattr(a, 'show') > In [9]: x > Out[9]: > > In [10]: y > Out[10

newbie question structure of function

2008-03-13 Thread menosaint
hi I am new to python programming..I would like to call a function that returns an integer value and a filename string as a tuple.I coded it like this below...I want to know if this can be coded more compactly and efficiently..(i am from java background and thus code often becomes bulky ..) de

Re: This actually works.

2008-03-13 Thread Dustan
On Mar 13, 3:16 pm, [EMAIL PROTECTED] wrote: > not self.believe > programming.screw() > > self.serious; this.works > > make_money(EASY) > anyone.can_do(this) you.screw() self.thank(God, encapsulation) not self.want_to_know(you.screw.func_code) programming.is_good -- http://mail.python.org/mailma

Problem with exec

2008-03-13 Thread Justus Schwabedal
I'm trying to parallise with python. Specifically I'm sending code to the processes and let them exec this code (in ascii form). However I ran into a problem with Namespaces (I think) which I do not understand. Here's what I do first: --- bash-3.2$ cat execB

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Arnaud Delobelle
On Mar 13, 10:06 pm, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > The following code has me mystified: > > In [4]: class A(object): >    ...:     def show(self): >    ...:         print 'hello' >    ...: >    ...: > In [5]: a = A() > In [6]: > In [7]: x = a.show > In [8]: y = getattr(a, 'show') > In [

Re: newbie question structure of function

2008-03-13 Thread castironpi
Just some FYI options. >     if not matchfilename: May return positive if you someday return an object that holds a 'not' value. >     resultname=""" That starts a string literal. > if (matchdistance < threshold): Parentheses optional. >     return (matchdistance,resultname) Parentheses opt

Re: This actually works.

2008-03-13 Thread Dotan Cohen
On 14/03/2008, Dustan <[EMAIL PROTECTED]> wrote: > you.screw() Ah, you are pushing sex pills. > self.thank(God, encapsulation) And bibles? Interesting combination. > not self.want_to_know(you.screw.func_code) Unsubscribe? I know better... Dotan Cohen http://what-is-what.com http://gibberi

RE: Dispatch("Excel.Application") failed

2008-03-13 Thread Ryan Ginstrom
> On Behalf Of John Machin > > '\xce\xde\xd0\xa7\xb5\xc4\xc0\xe0\xb1\xf0\xd7\xd6\xb7\xfb\xb4\xae', > > None, None) > > Googling for 2147221005 gives some clues. > > That string of hex stuff appears where an error message is > expected -- it's not utf8, and makes no sense when I attempt > to dec

Re: List mutation method gotcha - How well known?

2008-03-13 Thread Erik Max Francis
Chris wrote: > No output because x is a NoneType... That's behavior of the interactive interpreter when printing results of expressions, not of print. It will print None. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Dave Kuhlman
Arnaud Delobelle wrote: > > 4. Both points above follow from the fact that foo.bar is really a > function call that returns a (potentially) new object: in fact what > really happens is something like Arnaud and Imri, too - No. foo.bar is *not* really a function/method call. > > Foo.__di

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Erik Max Francis
Dave Kuhlman wrote: > Basically, the above code is saying that foo.foobar is not the same as > getattr(foo, 'foobar'). Python promises that the behavior is the same. It does not promise that the _objects_ will be the same, which is what `is` determines. That is, you're not doing a useful test

Re: Spaces in path name

2008-03-13 Thread Mensanator
On Mar 13, 5:16 pm, "David S" <[EMAIL PROTECTED]> wrote: > Hi, > > I have some code in which I have to change some path names to get it to > work. The original code seems to have assumed that path names would not have > any embedded spaces. > > I am not sure how to write the following line so when

sorting question

2008-03-13 Thread Patty Sutcliffe
The website you list regarding 9-letter scrambled words doesn't exist any longer. Is there another way that I can access it to see your program you designed? I have a nine letter work I need to unscramble. I will send it just in case you can figure it out for me and let me know. KAEOSYBR

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Diez B. Roggisch
> My understanding is that foo.bar does *not* create a new object. Your understanding is not correct. > All it > does is return the value of the bar attribute of object foo. What new > object is being created? A bound method. This happens through the descriptor-protocol. Please see this examp

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread castironpi
> > Basically, the above code is saying that foo.foobar is not the same as > > getattr(foo, 'foobar'). > > > What gives?  This breaks my understanding of id(), the is operator, and > > getattr(). > > 4.  Both points above follow from the fact that foo.bar is really a > function call that returns a

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Arnaud Delobelle
On Mar 13, 11:29 pm, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle wrote: > > > 4.  Both points above follow from the fact that foo.bar is really a > > function call that returns a (potentially) new object: in fact what > > really happens is something like > > Arnaud and Imri, too - >

Re: Python regex

2008-03-13 Thread Adonis Vargas
Andrew Rekdal < wrote: > I hope posting is ok here for this question... > > I am attempting to extract the text from a CSS comment using 're' such as... > > string = "/* CSS comment /*" > exp = "[^(/*)].*[^(*/)] " > > p = re.compile(exp) > q = p.search(string) > r = q.group() > > print r > >>>

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Mel
Diez B. Roggisch wrote: >> My understanding is that foo.bar does *not* create a new object. > > Your understanding is not correct. > >> All it >> does is return the value of the bar attribute of object foo. What new >> object is being created? > > A bound method. This happens through the descr

Advantage of the array module over lists?

2008-03-13 Thread Tobiah
I checked out the array module today. It claims that arrays are 'efficient'. I figured that this must mean that they are faster than lists, but this doesn't seem to be the case: one.py ## import array a = array.array('i') for x in xrange(1000): a.append

Re: Python-PHP bridge?

2008-03-13 Thread M�ta-MCI (MVP)
Hi! Only under Windows, you can use PHPscript. It's the "active-scripting" release of PHP. With it, you can send PHP's functions (source), and call these functions (with parameters). With the same method, you can also use, from Python, VBscript, Jscript, PerlScript, RubyScript. @-salutations

EuroPython 2008: A Call for Theme and Talk Suggestions

2008-03-13 Thread Paul Boddie
This year, the EuroPython conference will take up residence for the second time in Vilnius, Lithuania with the main programme of talks and events taking place on Monday 7th, Tuesday 8th and Wednesday 9th July, and with sprints continuing after the main programme until and including Saturday 12th Ju

Re: no more comparisons

2008-03-13 Thread Alan Isaac
Mark Dickinson wrote: > Sorting tuples, where the second item in the tuple should > have the opposite ordering to the first is going to be > a bit of a pain. Or even worse, where the ordering of the > second item depends on the value of the first item in the > tuple. This is like some

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread castironpi
On Mar 13, 7:18 pm, Mel <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > >> My understanding is that foo.bar does *not* create a new object. > > > Your understanding is not correct. > > >>  All it > >> does is return the value of the bar attribute of object foo.  What new > >> object is being

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread castironpi
On Mar 13, 7:45 pm, [EMAIL PROTECTED] wrote: > On Mar 13, 7:18 pm, Mel <[EMAIL PROTECTED]> wrote: > > > > > > > Diez B. Roggisch wrote: > > >> My understanding is that foo.bar does *not* create a new object. > > > > Your understanding is not correct. > > > >>  All it > > >> does is return the value

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread castironpi
On Mar 13, 8:15 pm, [EMAIL PROTECTED] wrote: > On Mar 13, 7:45 pm, [EMAIL PROTECTED] wrote: > > > > > > > On Mar 13, 7:18 pm, Mel <[EMAIL PROTECTED]> wrote: > > > > Diez B. Roggisch wrote: > > > >> My understanding is that foo.bar does *not* create a new object. > > > > > Your understanding is not

Re: no more comparisons

2008-03-13 Thread Dan Bishop
On Mar 13, 7:38 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: > Mark Dickinson wrote: > > Sorting tuples, where the second item in the tuple should > > have the opposite ordering to the first is going to be > > a bit of a pain. Or even worse, where the ordering of the > > second item depends on the va

How do I iterate over items in a dict grouped by N number of elements?

2008-03-13 Thread Noah
What is the fastest way to select N items at a time from a dictionary? I'm iterating over a dictionary of many thousands of items. I want to operate on only 100 items at a time. I want to avoid copying items using any sort of slicing. Does itertools copy items? This works, but is ugly: >>> from i

Re: no more comparisons

2008-03-13 Thread Mark Dickinson
On Mar 13, 8:38 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: > Does this do it? :: > >     key= lambda x: (-x[1],int(x2)) > > Here I am depending on the lexicographic sorting of tuples. > Without that there would be real trouble. Close. :-) I think it needs to be something like: key = lambda x: (-x

Re: image matching algorithms

2008-03-13 Thread Daniel Fetchinson
> > Since you seem to know quite a bit about this topic, what is your > > opinion on the apparently 'generic' algorithm described here: > > http://grail.cs.washington.edu/projects/query/ ? > > So far it seems to me that it does what I'm asking for, it does even > > more because it can take a hand d

RE: Dispatch("Excel.Application") failed

2008-03-13 Thread lialie
On Behalf Of John Machin > > > '\xce\xde\xd0\xa7\xb5\xc4\xc0\xe0\xb1\xf0\xd7\xd6\xb7\xfb\xb4\xae', > > > None, None) > > > Googling for 2147221005 gives some clues. > > That string of hex stuff appears where an error message is > expected -- it'

Re: How do I iterate over items in a dict grouped by N number of elements?

2008-03-13 Thread Paul Rubin
Noah <[EMAIL PROTECTED]> writes: > What is the fastest way to select N items at a time from a dictionary? > I'm iterating over a dictionary of many thousands of items. > I want to operate on only 100 items at a time. > I want to avoid copying items using any sort of slicing. I'd do something like

Re: sorting question

2008-03-13 Thread jcnbp8k
Hi Patty, That's easy solved, the word is keyboards. I just did a google search for 'anagram solver' and got lucky with Andy's free online anagram solver at http://www.ssynth.co.uk/~gay/anagram.html :) I know it's not a python script, though are you actually working on a python program to de

Re: How do I iterate over items in a dict grouped by N number of elements?

2008-03-13 Thread [EMAIL PROTECTED]
On Mar 13, 6:34 pm, Noah <[EMAIL PROTECTED]> wrote: > What is the fastest way to select N items at a time from a dictionary? > I'm iterating over a dictionary of many thousands of items. > I want to operate on only 100 items at a time. > I want to avoid copying items using any sort of slicing. > Do

Re: escape string to store in a database?

2008-03-13 Thread andrei . avk
On Mar 12, 8:32 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Wed, 2008-03-12 at 18:18 -0700, [EMAIL PROTECTED] wrote: > > These pieces of text may have single and double quotes in > > them, I tried escaping them using re module and string module and > > either I did something wrong, or they e

Re: sorting question

2008-03-13 Thread "Andrew Rekdal"
Seems 'KEYBOARDS' works nicely -- -- Andrew "jcnbp8k" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hi Patty, > > That's easy solved, the word is keyboards. > > I just did a google search for 'anagram solver' and got lucky with Andy's > free online anagram solver at http://www

Re: Problem with exec

2008-03-13 Thread alitosis
On Mar 14, 9:47 am, Justus Schwabedal <[EMAIL PROTECTED]> wrote: [snipped] > However when I do this: > > bash-3.2$ cat execBug2.py > #! /usr/bin/python > header=""" > from scipy import randn > def f(): > return randn() > """ > def g(): > exec header > return f() > print "

Need Script For read multiple files(.txt) from a folder

2008-03-13 Thread jai_python
hi frenz I Need a Python Script For read multiple files(.txt) from a folder and write it in a single text file Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: no more comparisons

2008-03-13 Thread Alan Isaac
Dan Bishop wrote: > Even assuming you meant (-x[0], int(x[1])), that sorts negative > numbers in the wrong order. You want > key = lambda x: (-1 if x[0] else 1) * int(x[1]) Sorry, was speed typing (very badly) and the question actually had two different problem descriptions. As you su

Re: Spaces in path name

2008-03-13 Thread David S
Hi, I get ERROR: ""C:\Program Files\apache-ant-1.7.0\bin\ant"" does not exist If I cut the path statement here and paste it next to a windows XP command prompt ant is invoked. The python code here is if not os.path.isfile(ANT_CMD): error('"%s" does not exist' % ANT_CMD) David "Me

Re: getattr/setattr still ASCII-only, not Unicode - blows up SGMLlib from BeautifulSoup

2008-03-13 Thread John Nagle
John Machin wrote: > On Mar 14, 5:38 am, John Nagle <[EMAIL PROTECTED]> wrote: >>Just noticed, again, that getattr/setattr are ASCII-only, and don't >> support >> Unicode. >> >>SGMLlib blows up because of this when faced with a Unicode end tag: >> >> File "/usr/local/lib/python2.5/

Re: newbie question structure of function

2008-03-13 Thread menosaint
Aaron thanx for the input > > resultname=""" > > That starts a string literal. i am not sure if this is the right way..i used it in case matchdistance < threshold return False.then the filename will not be taken from the filenameslist and so returns as an empty string. > > return (mat

Re: Need Script For read multiple files(.txt) from a folder

2008-03-13 Thread Chris
On Mar 14, 6:28 am, jai_python <[EMAIL PROTECTED]> wrote: > hi frenz I  Need a Python Script For read multiple files(.txt) from a > folder and write it in a single text file > > Thanks Take a look at the OS Module for the listdir funtion, you can use it to build a list of all files in the give

Re: getattr/setattr still ASCII-only, not Unicode - blows up SGMLlib from BeautifulSoup

2008-03-13 Thread Carl Banks
On Mar 14, 1:53 am, John Nagle <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > On Mar 14, 5:38 am, John Nagle <[EMAIL PROTECTED]> wrote: > >>Just noticed, again, that getattr/setattr are ASCII-only, and don't > >> support > >> Unicode. > > >>SGMLlib blows up because of this when faced

Monitoring SSHd and web servers?

2008-03-13 Thread Gilles Ganault
Hello I'd like to monitor connections to a remote SSH and web server. Does someone have some code handy that would try to connect every 5mn, and print an error if the script can't connect? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question structure of function

2008-03-13 Thread nodrogbrown
> > > resultname=""" > > > That starts a string literal. > > i am not sure if this is the right way..i used it in case > matchdistance < threshold return False.then the filename will not be > taken from the filenameslist and so returns as an empty string. >a one-tuple why not use None instea

<    1   2