ANNOUNCE: TGWebServices 1.2.4

2010-08-30 Thread Christophe de Vienne
Hi, I am pleased to announce the release of TGWebServices 1.2.4. Download: http://pypi.python.org/pypi/TGWebServices/1.2.4 Homepage: http://code.google.com/p/tgws/ What is it? === TGWebServices provides a very easy way to implement multi-procotol webservices in your TurboGears

JSONBOT 0.3 RELEASE

2010-08-30 Thread Bart Thate
Hello world ! I just released version 0.3 of JSONBOT. JSONBOT is a remote event driven framework for building bots that talk JSON to each other over XMPP. This distribution provides bots built on this framework for console, IRC, XMPP for the shell and WWW and XMPP for the Google Application

Re: Queue cleanup

2010-08-30 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: static void GetBufferInfo ( ... do /*once*/ { TheBufferInfo = PyObject_CallMethod(FromArray, buffer_info, ); if (TheBufferInfo == 0) break; AddrObj = PyTuple_GetItem(TheBufferInfo,

Re: Performance: sets vs dicts.

2010-08-30 Thread Raymond Hettinger
On Aug 29, 12:12 pm, John Nagle na...@animats.com 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

Passing variable to SQL statement when using psycopg2

2010-08-30 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 'xyz' come

Re: Tag parsing in python

2010-08-30 Thread agnibhu
On Aug 29, 5:43 pm, Paul McGuire pt...@austin.rr.com wrote: 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

Re: Performance: sets vs dicts.

2010-08-30 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 Arnaud suspects: no

Re: in place functions from operator module

2010-08-30 Thread Raymond Hettinger
On Aug 29, 8:33 am, Arnaud Delobelle arno...@googlemail.com wrote: 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:

Re: PyGeo

2010-08-30 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

Re: Passing variable to SQL statement when using psycopg2

2010-08-30 Thread Chris Rebert
On Sun, Aug 29, 2010 at 11:29 PM, Julia Jacobson julia.jacob...@arcor.de wrote: 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

Re: Queue cleanup

2010-08-30 Thread Paul Rubin
Steven D'Aprano steve-remove-t...@cybersource.com.au writes: I'm not saying that ref counting systems can avoid incrementing and decrementing the ref counts. That would be silly. But I'm saying that it is an accident of implementation that writing C extensions requires you to manually

Re: Queue cleanup

2010-08-30 Thread Steven D'Aprano
On Mon, 30 Aug 2010 00:22:17 -0700, Paul Rubin wrote: I don't think a C compiler could really manage automatic decrementing while still being C. Think especially of the common style of exception handling in C using longjmp. You might very well be right. But that's the problem with C -- it's

Re: Queue cleanup

2010-08-30 Thread Gregory Ewing
Paul Rubin wrote: These days I think the GC pause issue is overrated except for real-time control applications. Also for games, which are a fairly common application these days. Even a few milliseconds can be too long when you're trying to achieve smooth animation. I'd be disappointed if

Re: Problem checking an existing browser cookie

2010-08-30 Thread Nik the Greek
On 30 Αύγ, 06:12, MRAB pyt...@mrabarnett.plus.com wrote: 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.com    wrote: On 30/08/2010 02:14,

Re: String substitution VS proper mysql escaping

2010-08-30 Thread Gregory Ewing
Nik the Greek wrote: Yes i will i just asked to know if i were to substitute what might be the problem so to understand why i need the quoting. Because if you use % to build a query string, the result must be syntactically valid SQL. The values that you substitute into the placeholders must

Re: Queue cleanup

2010-08-30 Thread Lawrence D'Oliveiro
In message 7xr5hg3a7s@ruckus.brouhaha.com, Paul Rubin wrote: Actually that code looks suspicious. Suppose in AddrObj = PyTuple_GetItem(TheBufferInfo, 0); LenObj = PyTuple_GetItem(TheBufferInfo, 1); the first PyTuple_GetItem succeeds and the second one fails.

Re: Passing variable to SQL statement when using psycopg2

2010-08-30 Thread Gregory Ewing
Chris Rebert wrote: On Sun, Aug 29, 2010 at 11:29 PM, Julia Jacobson Where does the E in front of 'xyz' come from? It's probably the reason, why my query doesn't work. Quite doubtful, considering the example in the psycopg2 docs also has the E:

Re: Queue cleanup

2010-08-30 Thread Lawrence D'Oliveiro
In message 7x39twpuxi@ruckus.brouhaha.com, Paul Rubin wrote: 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.

Surge 2010 Early Registration ends Tuesday!

2010-08-30 Thread Jason Dixon
Early Bird Registration for Surge Scalability Conference 2010 ends next Tuesday, August 31. We have a killer lineup of speakers and architects from across the Internet. Listen to experts talk about the newest methods and technologies for scaling your Web presence.

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

2010-08-30 Thread News123
On 08/30/2010 02:09 AM, Steven D'Aprano wrote: 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. Thks a lot. I was looking in os.path and forgot about stat

comp.lang.python

2010-08-30 Thread roshini begum
www.127760.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGeo

2010-08-30 Thread Thomas Jollans
On Monday 30 August 2010, it occurred to L to exclaim: I have tried it and as soon as you try any of the examples in the examples dir it cannot find numpy etc I have manually move the pygeo dirs and contents to /usr/lib/python2.6/dis-packages, (this is the directory where numpy,

Re: Confused: Newbie Function Calls

2010-08-30 Thread Stefan Schwarzer
Hi Pinku, On 2010-08-11 21:35, Pinku Surana wrote: Even though I used the same name x for a local and global variable, they are actually completely different. When I call fun(x) it COPIES the global value of x into the local variable x in fun. [...] The global value isn't copied when calling

Re: Queue cleanup

2010-08-30 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: AddrObj = PyTuple_GetItem(TheBufferInfo, 0); LenObj = PyTuple_GetItem(TheBufferInfo, 1); the first PyTuple_GetItem succeeds and the second one fails. Admittedly, I did take a shortcut here: array.buffer_info

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

2010-08-30 Thread Thomas Jollans
On Monday 30 August 2010, it occurred to ru...@yahoo.com to exclaim: Face the facts dude. The Python docs have some major problems. They were pretty good when Python was a new, cool, project used by a handful of geeks. They are good relative to the average (whatever that is) open source

Re: help in code

2010-08-30 Thread Ulrich Eckhardt
Steven D'Aprano wrote: [reading Bengali] In Python 2, you probably need to do this: f = open(filename) bytes = f.read() text = bytes.decode('which-encoding-you-use') f.close() In Python 2, I'd rather take a look at the codecs module (see http://docs.python.org), namely the codecs.open

Re: Queue cleanup

2010-08-30 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: If it hasn't happened to you yet, you're either burning a bunch of effort that programmers of more automatic systems can put to more productive uses ... What makes you say that? Avoiding bugs is not a “productive use”? Avoiding

Re: Queue cleanup

2010-08-30 Thread Paul Rubin
Gregory Ewing greg.ew...@canterbury.ac.nz writes: These days I think the GC pause issue is overrated except for real-time control applications. Also for games, which are a fairly common application these days. Even a few milliseconds can be too long when you're trying to achieve smooth

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

2010-08-30 Thread Paul Rubin
Thomas Jollans tho...@jollybox.de writes: Actually, the Python standard library reference manual is excellent. At least that's my opinion What exactly are you comparing the Python docs to, I wonder? Obviously not something like Vala, but that goes without saying. I didn't know Vala had

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

2010-08-30 Thread Thomas Jollans
On Monday 30 August 2010, it occurred to Paul Rubin to exclaim: Thomas Jollans tho...@jollybox.de writes: Actually, the Python standard library reference manual is excellent. At least that's my opinion What exactly are you comparing the Python docs to, I wonder? Obviously not

Re: Simple Problem but tough for me if i want it in linear time

2010-08-30 Thread Aahz
In article mailman.2294.1282187962.1673.python-l...@python.org, Tim Chase python.l...@tim.thechases.com wrote: On 08/18/10 21:47, Steven D'Aprano wrote: Frankly, I think the OP doesn't really know what he wants, other than premature optimization. It's amazing how popular that is :) You see,

Re: Queue cleanup

2010-08-30 Thread Aahz
In article 4c7b279d$0$28650$c3e8...@news.astraweb.com, Steven D'Aprano steve-remove-t...@cybersource.com.au wrote: On Sun, 29 Aug 2010 17:52:38 -0700, Paul Rubin wrote: Attribution lost: That's a problem with the CPython API, not reference counting. The problem is that the CPython API is

Re: Using a function for regular expression substitution

2010-08-30 Thread naugiedoggie
On Aug 29, 1:14 pm, MRAB pyt...@mrabarnett.plus.com wrote: On 29/08/2010 15:22, naugiedoggie wrote: I'm having a problem with using a function as the replacement in re.sub(). Here is the function: def normalize(s) :      return

Re: Performance: sets vs dicts.

2010-08-30 Thread Aahz
In article f11e1bba-3846-41c0-a789-5fc799335...@p12g2000prn.googlegroups.com, Raymond Hettinger pyt...@rcn.com wrote: On Aug 29, 12:12=A0pm, John Nagle na...@animats.com 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

Re: Using a function for regular expression substitution

2010-08-30 Thread naugiedoggie
On Aug 30, 8:52 am, naugiedoggie michael.a.p...@gmail.com wrote: On Aug 29, 1:14 pm, MRAB pyt...@mrabarnett.plus.com wrote: On 29/08/2010 15:22, naugiedoggie wrote: I'm having a problem with using a function as the replacement in re.sub(). Here is the function: def normalize(s)

Re: Performance: sets vs dicts.

2010-08-30 Thread Paul Rubin
a...@pythoncraft.com (Aahz) writes: That reminds me: one co-worker (who really should have known better ;-) had the impression that sets were O(N) rather than O(1). Although writing that off as a brain-fart seems appropriate, it's also the case that the docs don't really make that clear, it's

Re: Problem checking an existing browser cookie

2010-08-30 Thread Nik the Greek
On 30 Αύγ, 11:01, Nik the Greek nikos.the.gr...@gmail.com wrote: On 30 Αύγ, 06:12, MRAB pyt...@mrabarnett.plus.com wrote: 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 Αύγ,

shlex, unicode, and subprocess.Popen on Windows

2010-08-30 Thread python
Python 2.6/Windows: shlex.split() does not support unicode strings. Is this simply a limitation of the current shlex implementation or is this an intentional design decision that reflects the behavior of how the Windows shell supports unicode values? Specifically, it doesn't appear that

Re: shlex, unicode, and subprocess.Popen on Windows

2010-08-30 Thread Chris Rebert
On Mon, Aug 30, 2010 at 6:54 AM, pyt...@bdurham.com wrote: Python 2.6/Windows: shlex.split() does not support unicode strings. Is this simply a limitation of the current shlex implementation or is this an intentional design decision that reflects the behavior of how the Windows shell supports

Re: Performance: sets vs dicts.

2010-08-30 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: That reminds me: one co-worker (who really should have known better ;-) had the impression that sets were O(N) rather than O(1). For settling exactly this kind of confusion, Python's standard library comes with a module, the ‘timeit’ module. Your co-worker

meta-class troubles

2010-08-30 Thread Ethan Furman
Good Day! I am stuck... hopefully a few fresh pairs of eyes will spot what I am missing. I have a metaclass, Traits, and two different testing files, test_traits.py and tests.py. test_traits works fine, tests generates the following error:

Re: meta-class troubles

2010-08-30 Thread Chris Rebert
On Mon, Aug 30, 2010 at 7:10 AM, Ethan Furman et...@stoneleaf.us wrote: Good Day! I am stuck... hopefully a few fresh pairs of eyes will spot what I am missing. I have a metaclass, Traits, and two different testing files, test_traits.py and tests.py.  test_traits works fine, tests generates

Re: meta-class troubles

2010-08-30 Thread Xavier Ho
Ethan, are you trying to write the constructor in the class statement? Cheers, Xav On 31 August 2010 00:10, Ethan Furman et...@stoneleaf.us wrote: Good Day! I am stuck... hopefully a few fresh pairs of eyes will spot what I am missing. I have a metaclass, Traits, and two different testing

Re: meta-class troubles

2010-08-30 Thread Xavier Ho
Actually, scrape what I said. I think you need to have metaclass in the class statement, not just meta. -Xav On 31 August 2010 00:16, Xavier Ho cont...@xavierho.com wrote: Ethan, are you trying to write the constructor in the class statement? Cheers, Xav On 31 August 2010 00:10, Ethan

Re: shlex, unicode, and subprocess.Popen on Windows

2010-08-30 Thread python
Hi Chris, It's a bug: http://bugs.python.org/issue1170 Thanks for pointing out the shlex bug. My concern was that shlex had Windows specific Unicode limitations because of the way the Windows shell so poorly supports unicode output. Kudos for avoiding shell=True My understanding is that the

python 2.6.6 installation problems on osx

2010-08-30 Thread jal
Hi All, I'm attempting a framework install of python 2.6.6 from source, on an intel mac running osx 10.6.4. At the end of the install the following errors occur. install: mkdir /usr/local/bin: Permission denied make[1]: *** [altinstallunixtools] Error 71 make: *** [frameworkaltinstallunixtools]

Re: How to implement a pipeline...??? Please help

2010-08-30 Thread Ritchy lelis
On 26 Ago, 08:52, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Tue, 24 Aug 2010 22:21:34 -0700 (PDT), Ritchy lelis ritchy_g...@hotmail.com declaimed the following in gmane.comp.python.general: hi friend Dennis Lee Bieber I have watching your code sujestion and now i can understand

Re: PyGeo

2010-08-30 Thread villorent
Maybe you could try this: http://hyry.dip.jp/files/pygeo.7z I found it on this page: http://hyry.dip.jp/blogt.py?file=0432.blog -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble importing cx_Oracle on HPUX

2010-08-30 Thread Cliff Martin
including libttsh11 fixed the problem. Thank you! Now I can get on with fixing everything that Python 3 broke... err changed. :) -- Cliff On Sat, Aug 28, 2010 at 11:20 AM, Alexander Gattin xr...@yandex.ru wrote: Hello, On Sat, Aug 28, 2010 at 09:27:05AM -0400, Cliff Martin wrote: Yes,

Re: python 2.6.6 installation problems on osx

2010-08-30 Thread Benjamin Kaplan
On Mon, Aug 30, 2010 at 10:29 AM, jal j...@bethere.co.uk wrote: Hi All, I'm attempting a framework install of python 2.6.6 from source, on an intel mac running osx 10.6.4. At the end of the install the following errors occur. install: mkdir /usr/local/bin: Permission denied make[1]: ***

Re: meta-class troubles

2010-08-30 Thread Ethan Furman
Chris Rebert wrote: Shouldn't meta= instead be metaclass= ? Xavier Ho wrote: I think you need to have metaclass in the class statement, not just meta. Argh. Thank you both. I'm glad it was simple! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Optimising literals away

2010-08-30 Thread Thomas Jollans
On Monday 30 August 2010, it occurred to Tobias Weber to exclaim: Hi, whenever I type an object literal I'm unsure what optimisation will do to it. def m(arg): if arg set([1,2,3]): return 4 Is the set created every time the method is called? What about a frozenset? Or tuple vs

Re: Optimising literals away

2010-08-30 Thread Benjamin Peterson
Tobias Weber towb at gmx.net writes: Hi, whenever I type an object literal I'm unsure what optimisation will do to it. def m(arg): if arg set([1,2,3]): return 4 Is the set created every time the method is called? Yes, and the list. What about a frozenset? Yep. Or

Re: Optimising literals away

2010-08-30 Thread Arnaud Delobelle
Tobias Weber t...@gmx.net writes: Hi, whenever I type an object literal I'm unsure what optimisation will do to it. def m(arg): if arg set([1,2,3]): return 4 Is the set created every time the method is called? What about a frozenset? Or tuple vs list? After how many calls per

Re: String substitution VS proper mysql escaping

2010-08-30 Thread Nik the Greek
On 30 Αύγ, 11:11, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Nik the Greek wrote: Yes i will i just asked to know if i were to substitute what might be the problem so to understand why i need the quoting. Because if you use % to build a query string, the result must be syntactically

JSONBOT 0.3 RELEASE

2010-08-30 Thread Bart Thate
Hello world ! I just released version 0.3 of JSONBOT. JSONBOT is a remote event driven framework for building bots that talk JSON to each other over XMPP. This distribution provides bots built on this framework for console, IRC, XMPP for the shell and WWW and XMPP for the Google Application

Re: Problem checking an existing browser cookie

2010-08-30 Thread Peter Otten
Nik the Greek wrote: Perhpas its doenst get loaded like that? # initialize cookie cookie = SimpleCookie() cookie.load( os.environ.get('HTTP_COOKIE', '') ) mycookie = cookie.get('visitor') Please someone else has an idea on how this to work? Add a print statement to verify that

Re: String substitution VS proper mysql escaping

2010-08-30 Thread Alexander Kapps
Nik the Greek wrote: cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' , a_tuple ) and cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' , (a_tuple) ) are both syntactically correct right? buw what about

Re: Problem checking an existing browser cookie

2010-08-30 Thread MRAB
On 30/08/2010 04:33, Nik the Greek wrote: On 30 Αύγ, 06:12, MRABpyt...@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

Re: String substitution VS proper mysql escaping

2010-08-30 Thread MRAB
On 30/08/2010 17:09, Nik the Greek wrote: On 30 Αύγ, 11:11, Gregory Ewinggreg.ew...@canterbury.ac.nz wrote: Nik the Greek wrote: Yes i will i just asked to know if i were to substitute what might be the problem so to understand why i need the quoting. Because if you use % to build a query

Re: String substitution VS proper mysql escaping

2010-08-30 Thread MRAB
On 30/08/2010 17:34, Alexander Kapps wrote: Nik the Greek wrote: cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' , a_tuple ) and cursor.execute(''' SELECT hits FROM counters WHERE page = %s and date = %s and host = %s ''' , (a_tuple) ) are both

Re: bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-30 Thread Chris Withers
Peter Otten wrote: My expectation of this is that if onerrors is left as None, names yielded will be importable. I would infer no such promise, especially as the generator also yields modules, and no attempt at all is made to import those. Really? I thought the __import__ fired over

python+sqlite3 in memory database

2010-08-30 Thread Denis Gomes
Hi Everyone, I am using sqlite3 with python2.5 and the pysqlite wrapper. I am trying to copy tables from one database (in memory) to another database (file) using ATTACH. I looked on the internet and found a couple of sites that show how to do this but the table schema is not copied. def

Re: Problem checking an existing browser cookie

2010-08-30 Thread Nik the Greek
On 30 Αύγ, 19:41, MRAB pyt...@mrabarnett.plus.com wrote: On 30/08/2010 04:33, Nik the Greek wrote: On 30 Αύγ, 06:12, MRABpyt...@mrabarnett.plus.com  wrote: This part:       ( not mycookie or mycookie.value != 'nikos' ) is false but this part:       re.search(

Re: Problem checking an existing browser cookie

2010-08-30 Thread Nik the Greek
On 30 Αύγ, 19:21, Peter Otten __pete...@web.de wrote: Nik the Greek wrote: Perhpas its doenst get loaded like that? # initialize cookie cookie = SimpleCookie() cookie.load( os.environ.get('HTTP_COOKIE', '') ) mycookie = cookie.get('visitor') Please someone else has an idea on how

Re: Helper app for intranet site

2010-08-30 Thread kevinlcarlson
On Aug 29, 8:46 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: 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.  

Re: Problem checking an existing browser cookie

2010-08-30 Thread Nik the Greek
On 30 Αύγ, 19:41, MRAB pyt...@mrabarnett.plus.com wrote: On 30/08/2010 04:33, Nik the Greek wrote: On 30 Αύγ, 06:12, MRABpyt...@mrabarnett.plus.com  wrote: This part:       ( not mycookie or mycookie.value != 'nikos' ) is false but this part:       re.search(

Re: shlex, unicode, and subprocess.Popen on Windows

2010-08-30 Thread Tim Golden
On 30/08/2010 3:24 PM, pyt...@bdurham.com wrote: My understanding is that the only time one needs to use shell=True is when they are 'executing' a non-executable file whose executable must be discovered via file association rules? Does that sound accurate? I'm not entirely sure what you mean

Re: Problem checking an existing browser cookie

2010-08-30 Thread Rami Chowdhury
On Mon, Aug 30, 2010 at 23:36, Nik the Greek nikos.the.gr...@gmail.com wrote: # initialize cookie cookie = SimpleCookie() cookie.load( os.environ.get('HTTP_COOKIE', '') ) visitor = cookie.get('visitor') This statement if (visitor.value != 'nikos') and re.search( r'(msn|yandex|13448|

Re: Problem checking an existing browser cookie

2010-08-30 Thread MRAB
On 30/08/2010 18:16, Nik the Greek wrote: On 30 Αύγ, 19:41, MRABpyt...@mrabarnett.plus.com wrote: On 30/08/2010 04:33, Nik the Greek wrote: On 30 Αύγ, 06:12, MRABpyt...@mrabarnett.plus.comwrote: This part: ( not mycookie or mycookie.value != 'nikos' ) is false but

Re: Problem checking an existing browser cookie

2010-08-30 Thread MRAB
On 30/08/2010 18:36, Nik the Greek wrote: On 30 Αύγ, 19:41, MRABpyt...@mrabarnett.plus.com wrote: On 30/08/2010 04:33, Nik the Greek wrote: On 30 Αύγ, 06:12, MRABpyt...@mrabarnett.plus.comwrote: This part: ( not mycookie or mycookie.value != 'nikos' ) is false but

Re: Problem checking an existing browser cookie

2010-08-30 Thread Nik the Greek
On 30 Αύγ, 20:53, MRAB pyt...@mrabarnett.plus.com wrote: Why visitor.value is undefined? Because visitor is None. It's not seeing any cookie. WHY NOT?! THE COOKIE _DOES_EXIST !!! What am i missing here?! -- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.6.6 installation problems on osx

2010-08-30 Thread jal
I just did 'make install' because according to the osx section of the README: On a clean OSX /usr/local does not exist. Do a sudo mkdir -m 775 /usr/local before you do a make install. It is probably not a good idea to do sudo make install which installs everything

Looking for Python and Python/Django workplaces in Chicago

2010-08-30 Thread Erik Reppen
I'm a really strong front end web dev with an interest in becoming more of a generalist web and app dev through Python. Anybody aware of studios/agencies that actually prefer Python in Chicago I could keep an eye on. -- http://mail.python.org/mailman/listinfo/python-list

Re: in place functions from operator module

2010-08-30 Thread Arnaud Delobelle
Raymond Hettinger pyt...@rcn.com writes: On Aug 29, 8:33 am, Arnaud Delobelle arno...@googlemail.com wrote: 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

Re: python+sqlite3 in memory database

2010-08-30 Thread Benjamin Peterson
Denis Gomes denisg640 at gmail.com writes: Eventually my goal is to dynamically load and unload sections of a file based database (could be tables or rows) in and out of memory for effeciency purposes. Have you actually found this to be an useful optimization? SQLite already internally caches

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

2010-08-30 Thread Terry Reedy
On 8/30/2010 7:14 AM, Paul Rubin wrote: example, tkinter has been part of the stdlib for at least a decade but is totally undocumented in the Python library manual. I have trouble equating 'totally undocumented' to about 400 lines + 200 for tix + 600 for ttk ;-). Yes, 400, while more than

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

2010-08-30 Thread Nobody
On Mon, 30 Aug 2010 12:50:32 +0200, Thomas Jollans wrote: Face the facts dude. The Python docs have some major problems. They were pretty good when Python was a new, cool, project used by a handful of geeks. They are good relative to the average (whatever that is) open source project -- but

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

2010-08-30 Thread Terry Reedy
On 8/30/2010 12:23 AM, ru...@yahoo.com wrote: The Python docs have some major problems. And I have no idea what you think they are. I have participated in 71 doc improvement issues on the tracker. Most of those I either initiated or provided suggestions. How many have you helped with? --

Re: shlex, unicode, and subprocess.Popen on Windows

2010-08-30 Thread Nobody
On Mon, 30 Aug 2010 10:24:26 -0400, python wrote: Kudos for avoiding shell=True My understanding is that the only time one needs to use shell=True is when they are 'executing' a non-executable file whose executable must be discovered via file association rules? Does that sound accurate?

Re: python+sqlite3 in memory database

2010-08-30 Thread Denis Gomes
Hey Benjamin, Take a look at this website I found about cached and in-memory databases. I think the gist of the article is that caching is good if you are doing SELECTs on data that is frequently used whereas in-memory speeds up writes, (inserts and updates) to the db as well as querying. Maybe

triangle python user's group?

2010-08-30 Thread Tim Arnold
Hi, Is there a python users group in the Research Triangle Park area (North Carolina, USA)? If there is not one and you're in the area and would be interested, please send an email to jtim.arnold at gmail.com and I'll organize a get-together to get one started. I'll try to find a locale

Re: python+sqlite3 in memory database

2010-08-30 Thread Benjamin Peterson
Denis Gomes denisg640 at gmail.com writes: Hey Benjamin,    Take a look at this website I found about cached and in-memory databases.  I think the gist of the article is that caching is good if you are doing SELECTs on data that is frequently used whereas in-memory speeds up writes, 

Re: triangle python user's group?

2010-08-30 Thread Albert Hopkins
On Mon, 2010-08-30 at 12:38 -0700, Tim Arnold wrote: Hi, Is there a python users group in the Research Triangle Park area (North Carolina, USA)? Google triangle python user's group -- http://mail.python.org/mailman/listinfo/python-list

Re: bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-30 Thread Peter Otten
Chris Withers wrote: Peter Otten wrote: My expectation of this is that if onerrors is left as None, names yielded will be importable. I would infer no such promise, especially as the generator also yields modules, and no attempt at all is made to import those. Really? Yes, and the

Re: String substitution VS proper mysql escaping

2010-08-30 Thread John Nagle
On 8/30/2010 1:11 AM, Gregory Ewing wrote: Nik the Greek wrote: Yes i will i just asked to know if i were to substitute what might be the problem so to understand why i need the quoting. Because if you use % to build a query string, the result must be syntactically valid SQL. The values that

Re: python+sqlite3 in memory database

2010-08-30 Thread Denis Gomes
Yep, I see what you are saying. I am going to do a bit more research to see how sqlite3 works internally, ie. cache size, page size, etc, and then decide if I will need to mess with in-memory databases. Thanks for your insight, appreciate it. Denis On Mon, Aug 30, 2010 at 3:51 PM, Benjamin

Re: python+sqlite3 in memory database

2010-08-30 Thread John Nagle
On 8/30/2010 12:00 PM, Benjamin Peterson wrote: Denis Gomesdenisg640at gmail.com writes: Eventually my goal is to dynamically load and unload sections of a file based database (could be tables or rows) in and out of memory for effeciency purposes. Have you actually found this to be an

Re: python+sqlite3 in memory database

2010-08-30 Thread Benjamin Peterson
John Nagle nagle at animats.com writes: sqlite has reasonably good SELECT performance on simple indices, but anything beyond that isn't all that great. Multiple processes updating the same sqlite database will have terrible performance, because the locking mechanism not only locks the

Re: Helper app for intranet site

2010-08-30 Thread Lawrence D'Oliveiro
In message 61894f54-90ff-4e0e-9c81-860b6e9cd...@p12g2000prn.googlegroups.com, kevinlcarlson wrote: On Aug 29, 8:46 pm, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message 45e0772c-24a8-4cbb-a4fc-74a1b6c25...@n19g2000prf.googlegroups.com, kevinlcarlson wrote: I'm

Re: Queue cleanup

2010-08-30 Thread Lawrence D'Oliveiro
In message 7xr5hguzzi@ruckus.brouhaha.com, Paul Rubin wrote: JHC (experimental Haskell compiler) recently started using a mixture of gc and region inference. It will be interesting to see how that works out. That’s what people have been saying about garbage collection for about half a

Re: Performance: sets vs dicts.

2010-08-30 Thread Aahz
In article 878w3ogpvq@benfinney.id.au, Ben Finney ben+pyt...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: That reminds me: one co-worker (who really should have known better ;-) had the impression that sets were O(N) rather than O(1). For settling exactly this kind of

Functions continuing to ru after returning something?

2010-08-30 Thread Bradley Hintze
I may be having a brain fart, but is it at all possible to have a function first return a value then continue its calculation. Like this simple example: my_var = 5 def my_function(): return my_var my_var +=1 This obviously won't work as written but is there a cleaver way around this. --

Re: Functions continuing to ru after returning something?

2010-08-30 Thread MRAB
On 31/08/2010 01:05, Bradley Hintze wrote: I may be having a brain fart, but is it at all possible to have a function first return a value then continue its calculation. Like this simple example: my_var = 5 def my_function(): return my_var my_var +=1 This obviously won't work as

Re: Queue cleanup

2010-08-30 Thread Paul Rubin
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: Meanwhile, real-world programmers get on to writing real-world code that is productive and efficient on real-world systems. It's pretty well established by now that GC doesn't have any significant speed penalty compared with manual

Re: Performance: sets vs dicts.

2010-08-30 Thread Paul Rubin
a...@pythoncraft.com (Aahz) writes: Possibly; IMO, people should not need to run timeit to determine basic algorithmic speed for standard Python datatypes. Indeed. Alex Stepanov (designer of C++ Standard Template Library) was emphatic that algorithm complexity assertions should be part of the

Structured programming with optionParser

2010-08-30 Thread NickC
I'm writing a short (200 lines) script that has half-a-dozen parameter options, and using optionParser to process the options. I try to write well-written procedural programmes with functions doing one thing well, and so on. The problem I'm getting is that, inevitably, the function that uses

Installing Python as Scripting Language in IIS

2010-08-30 Thread naugiedoggie
Hello, Windows 2003, 64-bit, standard edition server with IIS 6.0. I followed the MS instruction sheets on setting up CGI application with Python as scripting engine. I'm just getting 404 for the test script, whereas an html file in the same virtual directory is properly displayed. Here:

Source code for itertools

2010-08-30 Thread vsoler
I'm interested in studying the itertools source code, especially the permutations function. However, I cannot find the library. Where could I find it? Running Python 3.1 Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Source code for itertools

2010-08-30 Thread Lawrence D'Oliveiro
In message 9aa266f0-be9b-4c9a-bfbd-6cdfc86ad...@t20g2000yqa.googlegroups.com, vsoler wrote: I'm interested in studying the itertools source code, especially the permutations function. However, I cannot find the library. Where could I find it? l...@theon:python apt-get source python3.1

  1   2   >