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 thin

basketball shoe ( http://www.brandtrade66.com/

2010-08-29 Thread jersey-2009
hox Shoes (http:// www.brandtrade66.com/) shoes shox shoes (http:// www.brandtrade66.com/) nike shox shoe (http:// www.brandtrade66.com/) nike shox shoes ( http://www.brandtrade66.com/ ) shox shoe ( http://www.brandtrade66.com/ ) LV,coach,chanel boots wholesale ( http://www.brandtrade66.com/ ) air

Re: InteractiveConsole and namespace

2010-08-29 Thread Arnaud Delobelle
Chris Rebert writes: > On Sat, Aug 28, 2010 at 2:37 PM, David ROBERT 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 (ctrl-d) I want the program t

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 sit

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 is_palindrome_recursive_no_

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. I

Re: palindrome iteration

2010-08-29 Thread Arnaud Delobelle
Matteo Landi 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 > is_palindrome_reversed 3.289

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

2010-08-29 Thread Arnaud Delobelle
Osmo Maatta 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 > | |-- base_plug

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: > > > > > from distutils.core import setup, Extension > import distutils.ccompiler > > compilerName = distutils.ccompiler.get_default_comp

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.p

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

Re: Tag parsing in python

2010-08-29 Thread Paul McGuire
On Aug 28, 11:23 pm, Paul McGuire wrote: > On Aug 28, 11:14 am, agnibhu 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 > > user may use like > >

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 coor

Re: palindrome iteration

2010-08-29 Thread bruno.desthuilli...@gmail.com
On 27 août, 18:20, Mark Lawrence 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 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. When looking at it using pencil and pap

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 param

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

2010-08-29 Thread John Bokma
Gelonida 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 xautomation

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

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 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.unq

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 > > >

Re: in place functions from operator module

2010-08-29 Thread Arnaud Delobelle
ernest 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]: a >

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 vi

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 print

Re: Fibonacci: How to think recursively

2010-08-29 Thread Alain Ketterlin
Baba 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 myself > wi

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 tha

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 (http://groups.google.ie/group/

Re: Fibonacci: returning a selection of the series

2010-08-29 Thread Alain Ketterlin
Baba 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 and in gene

Re: String substitution VS proper mysql escaping

2010-08-29 Thread MRAB
On 29/08/2010 06:13, Νίκος wrote: On 28 Αύγ, 23:12, MRAB wrote: On 28/08/2010 20:51, Νίκος wrote: On 28 Αύγ, 22:35, MRABwrote: """When there's more than one value you provide a tuple. It's makes sense from the point of view of consistency that you also provide a tuple when ther

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

Re: Problem checking an existing browser cookie

2010-08-29 Thread MRAB
On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRAB wrote: On 28/08/2010 20:37, Íßêïò wrote: On 22 Áýã, 10:27, Íßêïòwrote: On 16 Áýã, 14:31, Peter Otten<__pete...@web.de>wrote: Íßêïò wrote: # initializecookie cookie=Cookie.SimpleCookie() cookie.load( os.environ.get('

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 s

Re: Fibonacci: returning a selection of the series

2010-08-29 Thread geremy condra
On Sun, Aug 29, 2010 at 10:36 AM, 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 > gener

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 developm

Re: palindrome iteration

2010-08-29 Thread bruno.desthuilli...@gmail.com
On 27 août, 20:05, Jussi Piitulainen > 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 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 !-) -- http://mail.python.org/mailman/listinfo/python-l

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 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 no tail call op

Re: Performance: sets vs dicts.

2010-08-29 Thread Arnaud Delobelle
John Nagle 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 implemented m

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 --> 0

Re: palindrome iteration

2010-08-29 Thread Roy Smith
In article <8dunm7fv5...@mid.individual.net>, Gregory Ewing 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 (http://bugs.python

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 wrote: > Well, I tried the also the solu

Re: palindrome iteration

2010-08-29 Thread MRAB
On 29/08/2010 21:34, Roy Smith wrote: In article<8dunm7fv5...@mid.individual.net>, Gregory Ewing 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

Re: palindrome iteration

2010-08-29 Thread Roy Smith
In article , MRAB wrote: > On 29/08/2010 21:34, Roy Smith wrote: > > In article<8dunm7fv5...@mid.individual.net>, > > Gregory Ewing 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

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'Aprano 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/, inspired by modern functional languages l

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 differenc

Re: Change case of package name on PyPI

2010-08-29 Thread Ben Finney
David Zaslavsky 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 more focussed dis

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 -- http

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 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 ques

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(

Re: problem in using linalg solver in numpy

2010-08-29 Thread Aahz
In article <242fd242-5f29-4358-8c12-f5763b7be...@g21g2000prn.googlegroups.com>, Pramod 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: http://projects.scipy.org/mailman/listinfo/numpy-discussion -- Aahz

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 matte

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Hans Mulder writes: > Parallelizable garbage collectors have performance issues, but they're > not the same issues as mark&sweep 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 free your twe

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Steven D'Aprano 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 "conservative" gc] Yeah, whether t

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Steven D'Aprano 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 six seconds later when the gc doe

Re: Problem checking an existing browser cookie

2010-08-29 Thread Νίκος
On 29 Αύγ, 21:44, MRAB wrote: > On 29/08/2010 06:34, Νίκος wrote: > > > > > > > > > On 28 Αύγ, 23:15, MRAB  wrote: > >> On 28/08/2010 20:37, Íßêïò wrote: > > >>> On 22 Áýã, 10:27, Íßêïò    wrote: > On 16 Áýã, 14:31, Peter Otten<__pete...@web.de>    wrote: > > > Íßêïò wrote: > >> # ini

Re: String substitution VS proper mysql escaping

2010-08-29 Thread Νίκος
On 29 Αύγ, 21:34, MRAB 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. > >> cursor.execute('''SELECT hits FROM

Re: Problem checking an existing browser cookie

2010-08-29 Thread MRAB
On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44, MRAB wrote: On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRABwrote: On 28/08/2010 20:37, Íßêïò wrote: On 22 Áýã, 10:27, Íßêïò wrote: On 16 Áýã, 14:31, Peter Otten<__pete...@web.de> wrote: Íßêïò wrote: # in

Re: String substitution VS proper mysql escaping

2010-08-29 Thread MRAB
On 30/08/2010 02:38, Νίκος wrote: On 29 Αύγ, 21:34, MRAB 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. I tri

Re: Problem checking an existing browser cookie

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 04:51, MRAB wrote: > On 30/08/2010 02:14, Νίκος wrote: > > > > > > > > > > > On 29 Αύγ, 21:44, MRAB  wrote: > >> On 29/08/2010 06:34, Νίκος wrote: > > >>> On 28 Αύγ, 23:15, MRAB    wrote: > On 28/08/2010 20:37, Íßêïò wrote: > > > On 22 Áýã, 10:27, Íßêïò      wrote: > >> On

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

2010-08-29 Thread alex23
kj 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 > it was an objec

Re: String substitution VS proper mysql escaping

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 05:04, MRAB 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) cursor.execute(''' SELECT hit

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, MRAB wrote: On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44, MRABwrote: On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRAB wrote: On 28/08/2010 20:37, Íßêïò wrote: On 22 Áýã, 10:27, Íßêïòwrote: On 1

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 -- http://mail.python.org/mailman/listinfo/python-li

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, MRAB 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

Re: Combining 2 regexes to 1

2010-08-29 Thread Chris Rebert
On Sun, Aug 29, 2010 at 7:40 PM, 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 E

Re: Problem checking an existing browser cookie

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 05:43, MRAB wrote: > On 30/08/2010 03:07, Nik the Greek wrote: > > > > > > > > > > > On 30 Αύγ, 04:51, MRAB  wrote: > >> On 30/08/2010 02:14, Νίκος wrote: > > >>> On 29 Αύγ, 21:44, MRAB    wrote: > On 29/08/2010 06:34, Νίκος wrote: > > > On 28 Αύγ, 23:15, MRAB      wrote: > >>>

Re: String substitution VS proper mysql escaping

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 05:48, MRAB wrote: > On 30/08/2010 03:33, Nik the Greek wrote: > > > > > > > > > On 30 Αύγ, 05:04, MRAB  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 = %

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/?([^/]*)', List)

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, MRAB wrote: On 30/08/2010 03:07, Nik the Greek wrote: On 30 Αύγ, 04:51, MRABwrote: On 30/08/2010 02:14, Νίκος wrote: On 29 Αύγ, 21:44, MRAB wrote: On 29/08/2010 06:34, Νίκος wrote: On 28 Αύγ, 23:15, MRAB

Re: Pop return from stack?

2010-08-29 Thread Aahz
In article <40a6bfac-3f4b-43f4-990b-224cb2b65...@i19g2000pro.googlegroups.com>, Carl Banks 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 traceback to me, i

Re: Problem checking an existing browser cookie

2010-08-29 Thread Nik the Greek
On 30 Αύγ, 06:12, MRAB 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 does executed bec

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. >

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 f

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 CPy

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 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 disagrees wi

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Lawrence D'Oliveiro 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, free. Here’s an example sn

Re: looking for open source python project

2010-08-29 Thread Brian Curtin
On Sat, Aug 28, 2010 at 19:50, mo reina 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 i'm not too sure

Re: Queue cleanup

2010-08-29 Thread Paul Rubin
Lawrence D'Oliveiro writes: > static void GetBufferInfo > ( ... > do /*once*/ > { > TheBufferInfo = PyObject_CallMethod(FromArray, "buffer_info", ""); > if (TheBufferInfo == 0) > break; > AddrObj = PyTuple_GetItem(TheBufferInfo, 0); > LenObj

Re: Performance: sets vs dicts.

2010-08-29 Thread Raymond Hettinger
On Aug 29, 12:12 pm, 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. There is no significant difference. All three are implemen

Passing variable to SQL statement when using psycopg2

2010-08-29 Thread Julia Jacobson
Dear python users, For passing a variable to a SQL query for psycopg2, I use: >>> my_var = xyz >>> print cur.mogrify("SELECT my_values FROM my_table WHERE my_column = %s",(my_var,)) This returns: >>> SELECT my_values FROM my_table WHERE my_column = E'xyz' Where does the "E" in front of '

Re: Tag parsing in python

2010-08-29 Thread agnibhu
On Aug 29, 5:43 pm, Paul McGuire wrote: > On Aug 28, 11:23 pm, Paul McGuire wrote: > > > > > On Aug 28, 11:14 am, agnibhu 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:

Re: Performance: sets vs dicts.

2010-08-29 Thread Peter Otten
Seth Rees wrote: > 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

Re: in place functions from operator module

2010-08-29 Thread Raymond Hettinger
On Aug 29, 8:33 am, Arnaud Delobelle wrote: > ernest 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 > >

Re: PyGeo

2010-08-29 Thread L
On 30/08/10 05:00, Thomas Jollans wrote: 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