Re: looking for open source python project

2010-08-29 Thread Kushal Kumaran
On Sun, Aug 29, 2010 at 6:20 AM, mo reina momo.re...@gmail.com wrote: looking for a python project (preferably something a bit small) that is looking for contributors. the small bit is because i've never worked in a team before and haven't really read source code that's 1000s of lines long, so

Re: palindrome iteration

2010-08-29 Thread Josh English
This whole conversation got interesting, so I thought I'd run some speed tests: The code: from timeit import Timer def is_palindrome_recursive(s): if len(s) = 1: return True if s[0] != s[-1]: return False else: return is_palindrome(s[1:-1]) def

Re: looking for open source python project

2010-08-29 Thread Daniel Fetchinson
looking for a python project (preferably something a bit small) that is looking for contributors. the small bit is because i've never worked in a team before and haven't really read source code that's 1000s of lines long, so i'm not too sure i can keep up. my python fu is decent (i think), i

basketball shoe free shipping paypal payment( http://www.brandtrade66.com/

2010-08-29 Thread jersey-2009
hox Shoes free shipping paypal payment(http:// www.brandtrade66.com/) shoes shox shoes free shipping paypal payment(http:// www.brandtrade66.com/) nike shox shoe free shipping paypal payment(http:// www.brandtrade66.com/) nike shox shoes free shipping paypal payment( http://www.brandtrade66.com/ )

Re: InteractiveConsole and namespace

2010-08-29 Thread Arnaud Delobelle
Chris Rebert c...@rebertia.com writes: On Sat, Aug 28, 2010 at 2:37 PM, David ROBERT da...@ombrepixel.com wrote: Hi all, I want to use an InteractiveConsole at some stage in a program to interact with the local namespace: access, but also modify objects. When the interactive console ends

PyGeo

2010-08-29 Thread L
has anyone successfully installed PyGeo under python 2.7 (prefer ubuntu 10.04) , the site says http://www.wspiegel.de/pymaxima/index_en.html Note: The installation of PyGeo work's only under Python 2.4 (The further development of pygeo seems to be stopped) is this to do with re-org of

Re: palindrome iteration

2010-08-29 Thread Matteo Landi
Well, I tried the also the solution posted above (recursive w/o slicing and iterative), and I discovered they were the slowest.. is_palindrome_recursive 2.68151649808 is_palindrome_slice 0.44510699381 is_palindrome_list 1.93861944217 is_palindrome_reversed 3.28969831976

Re: palindrome iteration

2010-08-29 Thread Gregory Ewing
Steven D'Aprano wrote: I'm not entirely sure what the use-case for swapcase is. Obviously it's for correcting things that were typed in with tHE cAPS lOCK kEY oN bY mISTAKE. :-) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Osmo Maatta
Hello, Sub class test fails. == I have a program that needs to load plugin-classes during runtime. The program has these subdirectories (modules). $ tree . `-- test.py | |-- plugins | |-- base_plugin.py | |-- base_plugin.pyc | |-- __init__.py | `-- oca |

Re: Queue cleanup

2010-08-29 Thread Hans Mulder
Steven D'Aprano wrote: On Sat, 28 Aug 2010 00:33:10 -0700, Paul Rubin wrote: If you drop the last reference to a complex structure, it could take quite a long time to free all the components. By contrast there are provably real-time tracing gc schemes, including some parallelizeable ones.

Re: palindrome iteration

2010-08-29 Thread Arnaud Delobelle
Matteo Landi landima...@gmail.com writes: Well, I tried the also the solution posted above (recursive w/o slicing and iterative), and I discovered they were the slowest.. is_palindrome_recursive 2.68151649808 is_palindrome_slice 0.44510699381 is_palindrome_list 1.93861944217

Re: Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Arnaud Delobelle
Osmo Maatta osm...@gmail.com writes: Hello, Sub class test fails. == I have a program that needs to load plugin-classes during runtime. The program has these subdirectories (modules). $ tree . `-- test.py | |-- plugins | |-- base_plugin.py | |--

Re: palindrome iteration

2010-08-29 Thread Matteo Landi
I thought they reached you. Here they are again: def palindrome(str, i=0, j=-1): try: if str[i] == str[j]: return palindrome(str, i + 1, j - 1) return False except IndexError: return True def palindrome(str, i=0, j=-1): try:

setuptools msvc build

2010-08-29 Thread Sazzad Kamal
is it possible to build python setuptools with msvc? On Monday, July 12, 2010 4:59 PM Alf P. Steinbach /Usenet wrote: I let the setup.py script talk: code from distutils.core import setup, Extension import distutils.ccompiler compilerName =

Re: Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Peter Otten
Osmo Maatta wrote: Hello, Sub class test fails. == I have a program that needs to load plugin-classes during runtime. The program has these subdirectories (modules). $ tree . `-- test.py | |-- plugins | |-- base_plugin.py | |-- base_plugin.pyc | |--

Re: Fibonacci: How to think recursively

2010-08-29 Thread News123
On 08/29/2010 01:12 AM, Baba wrote: Level: beginner I would like to know how to approach the following Fibonacci problem: How may rabbits do i have after n months? I'm not looking for the code as i could Google that very easily. I'm looking for a hint to put me on the right track to solve

Re: Tag parsing in python

2010-08-29 Thread Paul McGuire
On Aug 28, 11:23 pm, Paul McGuire pt...@austin.rr.com wrote: On Aug 28, 11:14 am, agnibhu dee...@gmail.com wrote: Hi all, I'm a newbie in python. I'm trying to create a library for parsing certain keywords. For example say I've key words like abc: bcd: cde: like that... So the

Re: Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Osmo Maatta
Re-hi and thank you. That solved my problem. I can now see that the base_plugin.Plugin is loaded several times. The numeric id(the_class) is not the same in all places. Anyway, I thought that a class is always the same if it has been loaded from the same module (in Linux/Unix; from the same file

controlling the mouse pointer on linux (or as vnc client)

2010-08-29 Thread Gelonida
Hi, From a python script I'd like to be able to move the mouse to certain absolute coordinates on the screen. There's no problems calling an external program with subprocess.popen, as I do not want to perform many movements. The mouse can jump it doesn't have to visibly move to the target

Re: palindrome iteration

2010-08-29 Thread bruno.desthuilli...@gmail.com
On 27 août, 18:20, Mark Lawrence breamore...@yahoo.co.uk wrote: On 27/08/2010 15:43, Bruno Desthuilliers wrote: Dave Angel a écrit : (snip) or (untested) def is_palindrom(s): s = s.lower() return s == s[::-1] Right, go on, make me feel a bit more stupid :-/ Who's next ? It

Re: Fibonacci: How to think recursively

2010-08-29 Thread Baba
On Aug 29, 3:25 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: Mathematically, there is nothing wrong with overlapping recursion. It will work, and Python can handle it easily. Based on the advice by Steven and Mel i tried my initial 'guess' and it does seem to work fine.

Using a function for regular expression substitution

2010-08-29 Thread naugiedoggie
Hello, I'm having a problem with using a function as the replacement in re.sub(). Here is the function: def normalize(s) : return urllib.quote(string.capwords(urllib.unquote(s.group('provider' The purpose of this function is to proper-case the words contained in a URL query string

Re: controlling the mouse pointer on linux (or as vnc client)

2010-08-29 Thread John Bokma
Gelonida gelon...@gmail.com writes: Hi, From a python script I'd like to be able to move the mouse to certain absolute coordinates on the screen. There's no problems calling an external program with subprocess.popen, as I do not want to perform many movements. xte? sudo apt-get install

in place functions from operator module

2010-08-29 Thread ernest
Hi, The operator module provides separate functions for in place operations, such as iadd(), isub(), etc. However, it appears that these functions don't really do the operation in place: In [34]: a = 4 In [35]: operator.iadd(a, 3) Out[35]: 7 In [36]: a Out[36]: 4 So, what's the point? If you

Re: in place functions from operator module

2010-08-29 Thread Peter Otten
ernest wrote: The operator module provides separate functions for in place operations, such as iadd(), isub(), etc. However, it appears that these functions don't really do the operation in place: In [34]: a = 4 In [35]: operator.iadd(a, 3) Out[35]: 7 In [36]: a Out[36]: 4 So,

Re: Using a function for regular expression substitution

2010-08-29 Thread Roy Smith
In article 9170aad0-478a-4222-b6e2-88d00899d...@t2g2000yqe.googlegroups.com, naugiedoggie michael.a.p...@gmail.com wrote: Hello, I'm having a problem with using a function as the replacement in re.sub(). Here is the function: def normalize(s) : return

Re: in place functions from operator module

2010-08-29 Thread ernest
On 29 Ago, 17:00, Peter Otten __pete...@web.de wrote: ernest wrote: The operator module provides separate functions for in place operations, such as iadd(), isub(), etc. However, it appears that these functions don't really do the operation in place: In [34]: a = 4 In [35]:

Re: in place functions from operator module

2010-08-29 Thread Arnaud Delobelle
ernest nfdi...@gmail.com writes: Hi, The operator module provides separate functions for in place operations, such as iadd(), isub(), etc. However, it appears that these functions don't really do the operation in place: In [34]: a = 4 In [35]: operator.iadd(a, 3) Out[35]: 7 In [36]:

Re: controlling the mouse pointer on linux (or as vnc client)

2010-08-29 Thread Gelonida
Hi John, Hi, From a python script I'd like to be able to move the mouse to certain absolute coordinates on the screen. There's no problems calling an external program with subprocess.popen, as I do not want to perform many movements. The mouse can jump it doesn't have to visibly move

Re: Using a function for regular expression substitution

2010-08-29 Thread Terry Reedy
On 8/29/2010 10:22 AM, naugiedoggie wrote: Hello, I'm having a problem with using a function as the replacement in re.sub(). Here is the function: def normalize(s) : return urllib.quote(string.capwords(urllib.unquote(s.group('provider' To debug your problem, I would start with

Re: Fibonacci: How to think recursively

2010-08-29 Thread Alain Ketterlin
Baba raoul...@gmail.com writes: Level: beginner I would like to know how to approach the following Fibonacci problem: How may rabbits do i have after n months? I'm not looking for the code as i could Google that very easily. I'm looking for a hint to put me on the right track to solve this

Re: Using a function for regular expression substitution

2010-08-29 Thread MRAB
On 29/08/2010 15:22, naugiedoggie wrote: Hello, I'm having a problem with using a function as the replacement in re.sub(). Here is the function: def normalize(s) : return urllib.quote(string.capwords(urllib.unquote(s.group('provider' This normalises the provider and returns only

Fibonacci: returning a selection of the series

2010-08-29 Thread Baba
level: beginner i would like to return a selection of the Fibonacci series. example: start = 5 ; end = 55 the function should then return [5, 8, 13, 21, 34, 55] it seems that this is best resolved using an iterative approach to generate the series. In another post

Re: Fibonacci: returning a selection of the series

2010-08-29 Thread Alain Ketterlin
Baba raoul...@gmail.com writes: i would like to return a selection of the Fibonacci series. example: start = 5 ; end = 55 the function should then return [5, 8, 13, 21, 34, 55] [...] my questios: - would you agree that recursive is not ideal for generating a list? (in this particular case

Re: String substitution VS proper mysql escaping

2010-08-29 Thread MRAB
On 29/08/2010 06:13, Νίκος wrote: On 28 Αύγ, 23:12, MRABpyt...@mrabarnett.plus.com wrote: On 28/08/2010 20:51, Νίκος wrote: On 28 Αύγ, 22:35, MRABpyt...@mrabarnett.plus.comwrote: When there's more than one value you provide a tuple. It's makes sense from the point of view of

Re: Fibonacci: How to think recursively

2010-08-29 Thread News123
Hi Baba, So here's my code. It does still cause me one headache. If i use f(0)=0 and f(1)=1 as base cases the result will be 144. I was expecting the result to be the next value in the series (233)... If i use f(1)=1 and f(2)=2 as base cases them i get my expected result. I assume this has

Re: Problem checking an existing browser cookie

2010-08-29 Thread MRAB
On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRABpyt...@mrabarnett.plus.com wrote: On 28/08/2010 20:37, Íßêïò wrote: On 22 Áýã, 10:27, Íßêïònikos.the.gr...@gmail.comwrote: On 16 Áýã, 14:31, Peter Otten__pete...@web.dewrote: Íßêïò wrote: # initializecookie

Re: Fibonacci: returning a selection of the series

2010-08-29 Thread News123
On 08/29/2010 07:36 PM, Baba wrote: level: beginner i would like to return a selection of the Fibonacci series. example: start = 5 ; end = 55 the function should then return [5, 8, 13, 21, 34, 55] it seems that this is best resolved using an iterative approach to generate the series.

Re: Fibonacci: returning a selection of the series

2010-08-29 Thread geremy condra
On Sun, Aug 29, 2010 at 10:36 AM, Baba raoul...@gmail.com wrote: level: beginner i would like to return a selection of the Fibonacci series. example: start = 5 ; end  = 55 the function should then return [5, 8, 13, 21, 34, 55] it seems that this is best resolved using an iterative approach

Re: PyGeo

2010-08-29 Thread Thomas Jollans
On Sunday 29 August 2010, it occurred to L to exclaim: has anyone successfully installed PyGeo under python 2.7 (prefer ubuntu 10.04) , the site says http://www.wspiegel.de/pymaxima/index_en.html Note: The installation of PyGeo work's only under Python 2.4 (The further development of

Re: palindrome iteration

2010-08-29 Thread bruno.desthuilli...@gmail.com
On 27 août, 20:05, Jussi Piitulainen jpiit...@ling.helsinki.fi def palindromep(s):     return ( s == or              ( s[0] == s[-1] and                palindromep(s[1:-1]) ) ) I-can-write-lisp-in-any-language-p !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: palindrome iteration

2010-08-29 Thread bruno.desthuilli...@gmail.com
On 29 août, 06:39, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Steven D'Aprano wrote:  I'm not entirely sure what the use-case for swapcase is. Obviously it's for correcting things that were typed in with tHE cAPS lOCK kEY oN bY mISTAKE. :-) +1 QOTW !-) --

Performance: sets vs dicts.

2010-08-29 Thread John Nagle
Is the in test faster for a dict or a set? Is frozenset faster than set? Use case is for things like applying in on a list of 500 or so words while checking a large body of text. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci: returning a selection of the series

2010-08-29 Thread Arnaud Delobelle
Baba raoul...@gmail.com writes: my questios: - would you agree that recursive is not ideal for generating a list? (in this particular case and in general) In Python that is probably correct in the vast majority of cases for two reasons: * lists in Python are implemented as arrays; * there is

Re: Performance: sets vs dicts.

2010-08-29 Thread Arnaud Delobelle
John Nagle na...@animats.com writes: Is the in test faster for a dict or a set? Is frozenset faster than set? Use case is for things like applying in on a list of 500 or so words while checking a large body of text. John Nagle IIRC Frozensets are

Re: Performance: sets vs dicts.

2010-08-29 Thread Peter Otten
John Nagle wrote: Is the in test faster for a dict or a set? Is frozenset faster than set? Use case is for things like applying in on a list of 500 or so words while checking a large body of text. As Arnaud suspects: no significant difference: $ python dictperf.py dict --

Re: palindrome iteration

2010-08-29 Thread Roy Smith
In article 8dunm7fv5...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Steven D'Aprano wrote: I'm not entirely sure what the use-case for swapcase is. Obviously it's for correcting things that were typed in with tHE cAPS lOCK kEY oN bY mISTAKE. :-) So it would seem

Re: palindrome iteration

2010-08-29 Thread Josh English
I have no idea. That's a lower level of programming than I'm used to dealing with. Josh (I also only tried the one value. Had I tried with other strings that would fail the test, some functions may have performed better.) On Aug 29, 2:19 am, Matteo Landi landima...@gmail.com wrote: Well, I

Re: palindrome iteration

2010-08-29 Thread MRAB
On 29/08/2010 21:34, Roy Smith wrote: In article8dunm7fv5...@mid.individual.net, Gregory Ewinggreg.ew...@canterbury.ac.nz wrote: Steven D'Aprano wrote: I'm not entirely sure what the use-case for swapcase is. Obviously it's for correcting things that were typed in with tHE cAPS lOCK

Re: palindrome iteration

2010-08-29 Thread Roy Smith
In article mailman.174.1283114875.29448.python-l...@python.org, MRAB pyt...@mrabarnett.plus.com wrote: On 29/08/2010 21:34, Roy Smith wrote: In article8dunm7fv5...@mid.individual.net, Gregory Ewinggreg.ew...@canterbury.ac.nz wrote: Steven D'Aprano wrote: I'm not entirely sure

Re: Functional composition in python

2010-08-29 Thread Audric Schiltknecht
Le 29/08/2010 04:54, Dmitry Groshev a écrit : On Aug 29, 5:14 am, Steven D'Apranost...@remove-this- cybersource.com.au wrote: On Sat, 28 Aug 2010 21:30:39 +0400, Dmitry Groshev wrote: Hello all. Some time ago I wrote a little library: http://github.com/si14/python-functional-composition/,

Re: Fibonacci: How to think recursively

2010-08-29 Thread Baba
Thanks to All for your kind help! Baba -- http://mail.python.org/mailman/listinfo/python-list

Change case of package name on PyPI

2010-08-29 Thread David Zaslavsky
Hi everyone, I recently uploaded a package to PyPI under a name with mixed-case letters, but in retrospect I think it'd be better to have the package name be all lowercase. Is there a way I can change it? Thanks, :) David -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance: sets vs dicts.

2010-08-29 Thread Seth Rees
On 08/29/10 14:43, Peter Otten wrote: John Nagle wrote: Is the in test faster for a dict or a set? Is frozenset faster than set? Use case is for things like applying in on a list of 500 or so words while checking a large body of text. As Arnaud suspects: no significant difference: $

Re: Change case of package name on PyPI

2010-08-29 Thread Ben Finney
David Zaslavsky diaz...@ellipsix.net writes: I recently uploaded a package to PyPI under a name with mixed-case letters, but in retrospect I think it'd be better to have the package name be all lowercase. Is there a way I can change it? Your question is on-topic here. However, you might get a

how to find out, whether a path is socket or device

2010-08-29 Thread News123
Hi, Under Linux I'd like to find out, whether I got a file, a character device or a socket as a parameter. What is the right way to do this How can I found out, whether a path name is: - a file ( os.isfile() ) - a character device - a socket - a named pipe thanks a lot for pointers --

Re: how to find out, whether a path is socket or device

2010-08-29 Thread Steven D'Aprano
On Mon, 30 Aug 2010 01:46:16 +0200, News123 wrote: Hi, Under Linux I'd like to find out, whether I got a file, a character device or a socket as a parameter. See the stat module. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Change case of package name on PyPI

2010-08-29 Thread David Zaslavsky
On Sunday 29 August 2010 7:09:37 pm Ben Finney wrote: David Zaslavsky diaz...@ellipsix.net writes: I recently uploaded a package to PyPI under a name with mixed-case letters, but in retrospect I think it'd be better to have the package name be all lowercase. Is there a way I can change it?

Re: in place functions from operator module

2010-08-29 Thread Steven D'Aprano
On Sun, 29 Aug 2010 07:44:47 -0700, ernest wrote: Hi, The operator module provides separate functions for in place operations, such as iadd(), isub(), etc. However, it appears that these functions don't really do the operation in place: In [34]: a = 4 In [35]: operator.iadd(a, 3)

Re: problem in using linalg solver in numpy

2010-08-29 Thread Aahz
In article 242fd242-5f29-4358-8c12-f5763b7be...@g21g2000prn.googlegroups.com, Pramod pram...@gmail.com wrote: When run the below program in python i got error like this , You may want to consider asking future questions on the NumPy list:

Re: Fibonacci: How to think recursively

2010-08-29 Thread Steven D'Aprano
On Sun, 29 Aug 2010 06:43:40 -0700, Baba wrote: So here's my code. It does still cause me one headache. If i use f(0)=0 and f(1)=1 as base cases the result will be 144. I was expecting the result to be the next value in the series (233)... That's because you're not generating the Fibonacci

Re: Fibonacci: returning a selection of the series

2010-08-29 Thread Steven D'Aprano
On Sun, 29 Aug 2010 10:36:45 -0700, Baba wrote: level: beginner i would like to return a selection of the Fibonacci series. example: start = 5 ; end = 55 the function should then return [5, 8, 13, 21, 34, 55] Start with something to lazily generate Fibonacci numbers. It doesn't matter

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Hans Mulder han...@xs4all.nl writes: Parallelizable garbage collectors have performance issues, but they're not the same issues as marksweep collectors have. Parallelizable GCs break up their work in a zillion little pieces and allow the VM to do some real work after each piece. They won't

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Steven D'Aprano st...@remove-this-cybersource.com.au writes: You can add cycle detection to a reference count gc, at the cost of more complexity. But then it's not purely a refcount gc. ;) If you read the Wikipedia article I linked to, tracing algorithms can also be unsound: [describes

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Steven D'Aprano st...@remove-this-cybersource.com.au writes: I could be wrong, but how can they not be subject to the same performance issue? If you have twenty thousand components that all have to be freed, they all have to be freed whether you do it when the last reference is cleared, or

Re: Problem checking an existing browser cookie

2010-08-29 Thread Νίκος
On 29 Αύγ, 21:44, MRAB pyt...@mrabarnett.plus.com wrote: On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRABpyt...@mrabarnett.plus.com  wrote: On 28/08/2010 20:37, Íßêïò wrote: On 22 Áýã, 10:27, Íßêïònikos.the.gr...@gmail.com    wrote: On 16 Áýã, 14:31, Peter

Re: String substitution VS proper mysql escaping

2010-08-29 Thread Νίκος
On 29 Αύγ, 21:34, MRAB pyt...@mrabarnett.plus.com wrote: It likes the values to be in a tuple. If there's one value, that's a 1-tuple: (page, ). I noticed that if we are dealing with just a single value 'page' will do, no need to tuple for 1-value. it handles fine as a string.

Re: Problem checking an existing browser cookie

2010-08-29 Thread MRAB
On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44, MRABpyt...@mrabarnett.plus.com wrote: On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRABpyt...@mrabarnett.plus.comwrote: On 28/08/2010 20:37, Íßêïò wrote: On 22 Áýã, 10:27, Íßêïònikos.the.gr...@gmail.com wrote: On

Re: String substitution VS proper mysql escaping

2010-08-29 Thread MRAB
On 30/08/2010 02:38, Νίκος wrote: On 29 Αύγ, 21:34, MRABpyt...@mrabarnett.plus.com wrote: It likes the values to be in a tuple. If there's one value, that's a 1-tuple: (page, ). I noticed that if we are dealing with just a single value 'page' will do, no need to tuple for 1-value. it

Re: Problem checking an existing browser cookie

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 04:51, MRAB pyt...@mrabarnett.plus.com wrote: On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44, MRABpyt...@mrabarnett.plus.com  wrote: On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRABpyt...@mrabarnett.plus.com    wrote: On 28/08/2010 20:37, Íßêïò wrote:

Re: How to convert (unicode) text to image?

2010-08-29 Thread alex23
kj no.em...@please.post wrote: Example: I went to the docs page for ImageDraw.  There I find that the constructor for an ImageDraw.Draw object takes an argument, but *what* this argument should be (integer? object? string?) is left entirely undefined.  From the examples given I *guessed* that

Re: String substitution VS proper mysql escaping

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 05:04, MRAB pyt...@mrabarnett.plus.com wrote: when iam trying to pass a tuple to the execute methos should i pass it like this? cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' % (page, date, host) ) or like tuple = (page, host, date)

Re: Problem checking an existing browser cookie

2010-08-29 Thread MRAB
On 30/08/2010 03:07, Nik the Greek wrote: On 30 Αύγ, 04:51, MRABpyt...@mrabarnett.plus.com wrote: On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44, MRABpyt...@mrabarnett.plus.comwrote: On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRABpyt...@mrabarnett.plus.com wrote:

Combining 2 regexes to 1

2010-08-29 Thread Niklasro(.appspot)
Hello, Suspecting it's completely doable combining these 2 regexes to just 1 expression I'm looking for the working syntax. If you know then kindly inform. Thanks in advance ('/a/([^/]*)',List), #list ('/a([^/]*)',List), #list Niklas Rosencrantz --

Re: String substitution VS proper mysql escaping

2010-08-29 Thread MRAB
On 30/08/2010 03:33, Nik the Greek wrote: On 30 Αύγ, 05:04, MRABpyt...@mrabarnett.plus.com wrote: when iam trying to pass a tuple to the execute methos should i pass it like this? cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' % (page, date, host)

Re: Combining 2 regexes to 1

2010-08-29 Thread Chris Rebert
On Sun, Aug 29, 2010 at 7:40 PM, Niklasro(.appspot) nikla...@gmail.com wrote: Hello, Suspecting it's completely doable combining these 2 regexes to just 1 expression I'm looking for the working syntax. If you know then kindly inform. Thanks in advance ('/a/([^/]*)',List), #list

Re: Problem checking an existing browser cookie

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 05:43, MRAB pyt...@mrabarnett.plus.com wrote: On 30/08/2010 03:07, Nik the Greek wrote: On 30 Αύγ, 04:51, MRABpyt...@mrabarnett.plus.com  wrote: On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44, MRABpyt...@mrabarnett.plus.com    wrote: On 29/08/2010 06:34, Νίκος

Re: String substitution VS proper mysql escaping

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 05:48, MRAB pyt...@mrabarnett.plus.com wrote: On 30/08/2010 03:33, Nik the Greek wrote: On 30 Αύγ, 05:04, MRABpyt...@mrabarnett.plus.com  wrote: when iam trying to pass a tuple to the execute methos should i pass it like this? cursor.execute(''' SELECT hits FROM

Re: Combining 2 regexes to 1

2010-08-29 Thread MRAB
On 30/08/2010 03:40, Niklasro(.appspot) wrote: Hello, Suspecting it's completely doable combining these 2 regexes to just 1 expression I'm looking for the working syntax. If you know then kindly inform. Thanks in advance ('/a/([^/]*)',List), #list ('/a([^/]*)',List), #list ('/a/?([^/]*)',

Re: Problem checking an existing browser cookie

2010-08-29 Thread MRAB
On 30/08/2010 03:55, Nik the Greek wrote: On 30 Αύγ, 05:43, MRABpyt...@mrabarnett.plus.com wrote: On 30/08/2010 03:07, Nik the Greek wrote: On 30 Αύγ, 04:51, MRABpyt...@mrabarnett.plus.comwrote: On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44,

Re: Pop return from stack?

2010-08-29 Thread Aahz
In article 40a6bfac-3f4b-43f4-990b-224cb2b65...@i19g2000pro.googlegroups.com, Carl Banks pavlovevide...@gmail.com wrote: FWIW, I think it perfectly reasonable to let an application print a traceback on an error. I've gotten a few bug reports on a little tool I maintain where the user copies the

Re: Problem checking an existing browser cookie

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 06:12, MRAB pyt...@mrabarnett.plus.com wrote: This part:      ( not mycookie or mycookie.value != 'nikos' ) is false but this part:      re.search( r'(msn|yandex|13448|spider|crawl)', host ) is None is true because host doesn't contain any of those substrings. So, the if code

Re: Queue cleanup

2010-08-29 Thread Steven D'Aprano
On Sun, 29 Aug 2010 17:52:38 -0700, Paul Rubin wrote: That's a problem with the CPython API, not reference counting. The problem is that the CPython API is written at too low a level, beneath that at which the garbage collector exists, so naturally you have to manually manage memory. Care

Re: Helper app for intranet site

2010-08-29 Thread Lawrence D'Oliveiro
In message 45e0772c-24a8-4cbb-a4fc-74a1b6c25...@n19g2000prf.googlegroups.com, kevinlcarlson wrote: I'm exploring the possibility of developing a helper app for an existing internal company website. Basically, it would automatically scan the current page contents, including prepopulated

Re: Queue cleanup

2010-08-29 Thread Lawrence D'Oliveiro
In message 7x4oeftuk4@ruckus.brouhaha.com, Paul Rubin wrote: I'd say [reference-counting is] not real gc because 1) it's unsound (misses reference cycles), and 2) it requires constant attention from the mutator to incr and decr the reference counts. So developing modules for the CPython

Re: Combining 2 regexes to 1

2010-08-29 Thread Niklasro(.appspot)
Many thanks. It works. You also helped me refactor these ('/([0-9]*)/?([^/]*)',AById),#id2a ('/([0-9]*)',AById) to just 1 ('/([0-9]*)/?([^/]*)',AById),#id2a It's from the appspot framework. Sincerely Niklas R -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert (unicode) text to image?

2010-08-29 Thread ru...@yahoo.com
On 08/29/2010 08:21 PM, alex23 wrote: kj no.em...@please.post wrote: snip Sorry for the outburst, but unfortunately, PIL is not alone in this. Python is awash in poor documentation. [...] I have to conclude that the problem with Python docs is somehow systemic... Yes, if everyone else

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: the CPython API means endlessly finding and fixing refcount bugs that lead to either crashes/security failures, or memory leaks. I don’t see why that should be so. It seems a very simple discipline to follow: initialize, allocate,

Re: looking for open source python project

2010-08-29 Thread Brian Curtin
On Sat, Aug 28, 2010 at 19:50, mo reina momo.re...@gmail.com wrote: looking for a python project (preferably something a bit small) that is looking for contributors. the small bit is because i've never worked in a team before and haven't really read source code that's 1000s of lines long, so

[issue4356] Add key argument to bisect module functions

2010-08-29 Thread Sean Reifschneider
Sean Reifschneider j...@tummy.com added the comment: This issue came up on #python IRC, and that combined with the number of times this has been duplicated makes me think that maybe the mention of the SortedCollection recipe should be a little more prominent. Perhaps either moved up by the

[issue9706] ssl errors checking

2010-08-29 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: A simple IOError No such file or directory 'xxx' exception would be a lot more clear. Agreed, but the OpenSSL error reporting system looks too convoluted (or braindead) to easily allow such aliasing of errors. If you have an idea,

[issue9706] ssl errors checking

2010-08-29 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- Removed message: http://bugs.python.org/msg115166 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9706 ___

[issue8266] tarfile library should support xz compression

2010-08-29 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- superseder: - please support lzma compression as an extension and in the tarfile module ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8266 ___

[issue8075] Windows (Vista/7) install error when choosing to compile .py files

2010-08-29 Thread Andreas Schlapsi
Changes by Andreas Schlapsi andreas.schla...@gmail.com: -- nosy: +Andreas.Schlapsi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8075 ___ ___

[issue1225769] Proposal to implement comment rows in csv module

2010-08-29 Thread florian-rathgeber
Changes by florian-rathgeber florian.rathge...@gmail.com: -- nosy: +florian-rathgeber ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1225769 ___

[issue1537721] csv module: add header row to DictWriter

2010-08-29 Thread florian-rathgeber
Changes by florian-rathgeber florian.rathge...@gmail.com: -- nosy: +florian-rathgeber ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1537721 ___

[issue9706] ssl errors checking

2010-08-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The only idea which comes to mind is try to open() the file before calling load_cert_chain(). That would automatically also take care of permission errors, etc.. Not very clean, but... :-\ It's vulnerable to various issues such as race

[issue9425] Rewrite import machinery to work with unicode paths

2010-08-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Added file: http://bugs.python.org/file18671/Py_UNICODE_strcat.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9425 ___

[issue9425] Rewrite import machinery to work with unicode paths

2010-08-29 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Py_UNICODE_strcat.patch: create Py_UNICODE_strcat() function. Py_UNICODE_strdup.patch: create Py_UNICODE_strdup() function. -- Added file: http://bugs.python.org/file18672/Py_UNICODE_strdup.patch

[issue9709] test_distutils warning: initfunc exported twice on Windows

2010-08-29 Thread Stefan Krah
New submission from Stefan Krah stefan-use...@bytereef.org: On Windows, the initfunc of a C extension is exported twice, as seen here: test_distutils xxmodule.c xxmodule.obj : warning LNK4197: export 'initxx' specified multiple times; using first specification First export: pyport.h: #define

  1   2   >