Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-02 Thread Chris Withers
Xah Lee wrote: Haskell has a new logo. A fantastic one. Beautiful. For creator, context, detail, see bottom of: What does this have to do with Python? Nothing. So why are you posting it to comp.lang.python? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting

Re: Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Albert Hopkins
On Fri, 2009-10-02 at 20:22 -0400, Simon Forman wrote: > 2.5 +1 I'd like to suggest 2.46 instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Ben Finney
Philip Semanchuk writes: > Our project uses some libraries that were written by 3rd parties (i.e. > not us). These libraries fit into a single Python file and live in our > source tree alongside other modules we've written. Why in the same source tree? They are maintained separately, so you shou

Re: Q: sort's key and cmp parameters

2009-10-02 Thread Raymond Hettinger
[Paul Rubin] > The idea was that you have a list of trees that you want to sort, and > an ordering relation between trees: > >    def gt(tree1, tree2): ... Are the trees user defined classes? Can the gt() function be added incorporated as __lt__ method so that you can just run a plain sort:

Re: Q: sort's key and cmp parameters

2009-10-02 Thread Raymond Hettinger
[Paul Rubin] > The idea was that you have a list of trees that you want to sort, and > an ordering relation between trees: > >    def gt(tree1, tree2): ... > > where you recursively descend both trees until you find an unequal > pair of nodes.  You're not trying to sort the nodes within a single >

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-02 Thread Dave Searles
Xah Lee wrote: Haskell has a new logo. [Blam! It fucking blows because lambda means pure functional] A truly pure functional language would be useless for anything but programming space heaters. Lambda seems not inappropriate on any language that strongly supports a functional style. Schem

Re: removing a post

2009-10-02 Thread Aahz
In article , Sjoerd Mullender wrote: >On 2009-09-26 05:32, Mike L wrote: >> >> could you remove this old post, off topic and spam >> >> http://www.mail-archive.com/python-list@python.org/msg175722.html > >You need to put this request to postmas...@python.org. As mailing list >administrator I h

Re: Regular expression to structure HTML

2009-10-02 Thread greg
Brian D wrote: This isn't merely a question of knowing when to use the right tool. It's a question about how to become a better developer using regular expressions. It could be said that if you want to learn how to use a hammer, it's better to practise on nails rather than screws. -- Greg --

Re: Q: sort's key and cmp parameters

2009-10-02 Thread Paul Rubin
Raymond Hettinger writes: > I'm not sure what you mean by this. What are the semantics of > sorting a tree? Can you outline an example of tree that > could be sorted easily with a cmp function but not a key function? The idea was that you have a list of trees that you want to sort, and an order

Re: int rich comparisons

2009-10-02 Thread Terry Reedy
Robert Kern wrote: George Sakkis wrote: I stumbled upon the following strangeness (python 2.6.2): getattr(int, '__gt__') getattr(5, '__gt__') Traceback (most recent call last):n File "", line 1, in AttributeError: 'int' object has no attribute '__gt__' Is this a bug ? I believe that

organizing your scripts, with plenty of re-use

2009-10-02 Thread bukzor
I would assume that putting scripts into a folder with the aim of re- using pieces of them would be called a package, but since this is an "anti-pattern" according to Guido, apparently I'm wrong-headed here. (Reference: http://mail.python.org/pipermail/python-3000/2007-April/006793.html ) Say you

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-02 Thread Kenneth Tilton
Pascal J. Bourguignon wrote: Kenneth Tilton writes: Xah Lee wrote: Haskell has a new logo. A fantastic one. Beautiful. For creator, context, detail, see bottom of: • A Lambda Logo Tour http://xahlee.org/UnixResource_dir/lambda_logo.html Don't do that! If you want to watch the logo, just

Re: Q: sort's key and cmp parameters

2009-10-02 Thread Raymond Hettinger
[Paul Rubin] > Yes, think of sorting tree structures where you have to recursively > compare them til you find an unequal pair of nodes.   I'm not sure what you mean by this. What are the semantics of sorting a tree? Can you outline an example of tree that could be sorted easily with a cmp funct

Re: Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Simon Forman
On Fri, Oct 2, 2009 at 3:50 PM, Philip Semanchuk wrote: > Hi all, > Our project uses some libraries that were written by 3rd parties (i.e. not > us). These libraries fit into a single Python file and live in our source > tree alongside other modules we've written. When our app is distributed, > th

Re: Concurrent threads to pull web pages?

2009-10-02 Thread Kyle Terry
On Thu, Oct 1, 2009 at 6:33 PM, wrote: > On 1 Oct, 09:28 am, nos...@nospam.com wrote: > >> Hello >> >>I recently asked how to pull companies' ID from an SQLite database, >> have multiple instances of a Python script download each company's web >> page from a remote server, eg. www.acme.co

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-02 Thread Pascal J. Bourguignon
Kenneth Tilton writes: > Xah Lee wrote: >> Haskell has a new logo. A fantastic one. Beautiful. For creator, >> context, detail, see bottom of: >> • A Lambda Logo Tour >> http://xahlee.org/UnixResource_dir/lambda_logo.html Don't do that! If you want to watch the logo, just google for haskell

Re: Python resident memory retention & Evan Jones' improvements

2009-10-02 Thread Andrew MacIntyre
Matt Ernst wrote: {...} I thought Evan Jones altered Python to deal with this very problem, and the change went into the release of 2.5. Here is Tim Peters announcing the change: http://mail.python.org/pipermail/python-dev/2006-March/061991.html He included this simple test program to show th

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-02 Thread Kenneth Tilton
Xah Lee wrote: Haskell has a new logo. A fantastic one. Beautiful. For creator, context, detail, see bottom of: • A Lambda Logo Tour http://xahlee.org/UnixResource_dir/lambda_logo.html Cool survey, and yes, that is a nice new one for Haskell. I saw beauty the other day changing an applicati

Haskell's new logo, and the idiocy of tech geekers

2009-10-02 Thread Xah Lee
Haskell has a new logo. A fantastic one. Beautiful. For creator, context, detail, see bottom of: • A Lambda Logo Tour http://xahlee.org/UnixResource_dir/lambda_logo.html this is posted here because it relates to various computer software/ language's logo, a subject discussed by me several times

Re: numpy f2py question

2009-10-02 Thread sturlamolden
http://projects.scipy.org/numpy/ticket/1247 -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast decimal arithmetic module released

2009-10-02 Thread Raymond Hettinger
[Stefan Krah] > today I have released the following packages for fast arbitrary precision > decimal arithmetic: Nice. Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy f2py question

2009-10-02 Thread sturlamolden
On 2 Okt, 22:41, George Trojan wrote: > I have a problem with numpy's vectorize class and f2py wrapped old > FORTRAN code. I found that the function _get_nargs() in > site-packages/numpy/lib/function_base.py tries to find the number of > arguments for a function from an error message generated whe

multiprocessing newbie - semaphore question

2009-10-02 Thread xera121
Hi, I'm interested in this type of programming but need some fundamental questions answered if someone could oblige: In the docs for the mutiprocessing module it mentions right at the beginning about an underlying semaphore system - would MPI2 fit the bill running on a Beowulf cluster? Is the mut

Python resident memory retention & Evan Jones' improvements

2009-10-02 Thread Matt Ernst
My apologies in advance if this has been addressed before. Google does not presently seem to return search results for this group from more than a couple of months ago. I have some long-running Python processes that slowly increase in resident memory size, and whose resident size goes down only wh

Re: Threaded GUI slowing method execution?

2009-10-02 Thread sturlamolden
On 2 Okt, 22:29, Aaron Hoover wrote: > My external hardware is actually sending 2000 packets per second right   > now (but that can also be changed). Each packet currently contains 6   > bytes of data and 6 bytes of overhead. So, 12 bytes per packet * 2000   > packets per second is 24k bytes per

Re: Multiple Select

2009-10-02 Thread Ethan Furman
Victor Subervi wrote: I have the select called variable "these". Whichever option is selected is passed through the cgi: import cgitb; cgitb.enable() import cgi form = cgi.FieldStorage() these = form.getfirst('these', '') As I mentioned before, I get the variable all right. That is not the i

Re: Multiple Select

2009-10-02 Thread Victor Subervi
I have the select called variable "these". Whichever option is selected is passed through the cgi: import cgitb; cgitb.enable() import cgi form = cgi.FieldStorage() these = form.getfirst('these', '') As I mentioned before, I get the variable all right. That is not the issue. What is the issue is

Re: Multiple Select

2009-10-02 Thread Rami Chowdhury
On Fri, 02 Oct 2009 14:25:55 -0700, Victor Subervi wrote: Hi; I'm trying to create an HTML with several options in a form that is posted to a script. I want to enable the user to select multiple options. The problem is I don't know how to call those options in my cgi calls in the script

Multiple Select

2009-10-02 Thread Victor Subervi
Hi; I'm trying to create an HTML with several options in a form that is posted to a script. I want to enable the user to select multiple options. The problem is I don't know how to call those options in my cgi calls in the script to which it posts. Only one of them gets associated with the variabl

Re: Threaded GUI slowing method execution?

2009-10-02 Thread Aaron Hoover
On Oct 2, 2009, at 12:30 PM, Dave Angel wrote: (you responded off-list, which isn't the way these mailing lists work. So I'm pasting your message back to the list, with my response at the end) Sorry about that - a slip of the "reply" button. Actually, I was thinking of the subprocess

Re: Simple Python struct issue

2009-10-02 Thread Carlo DiCelico
On Oct 2, 12:49 pm, MRAB wrote: > Carlo DiCelico wrote: > > I saw an article on O'Reilly about using NumPy and Dislin to analyze > > and visualize WAV files. It's a really fantastic article but was a > > little out of date. I updated the script to work with the newer > > modules &etc but am still

Re: Simple Python struct issue

2009-10-02 Thread Carlo DiCelico
On Oct 2, 3:17 pm, Simon Forman wrote: > On Fri, Oct 2, 2009 at 12:35 PM, Carlo DiCelico > > > > > > wrote: > > On Oct 2, 12:15 pm, Simon Forman wrote: > >> On Fri, Oct 2, 2009 at 12:07 PM, Carlo DiCelico > >> wrote: > >> > I saw an article on O'Reilly about using NumPy and Dislin to analyze >

Re: Q: sort's key and cmp parameters

2009-10-02 Thread Paul Rubin
Scott David Daniels writes: > Most cases are moreeasily done with key, and it is > a good idea to make the most accessible way to a sort be the most > efficient one. In the rare case that you really want each comparison, > the cmp-injection function will do nicely (and can be written as a > recip

Re: int rich comparisons

2009-10-02 Thread Robert Kern
George Sakkis wrote: I stumbled upon the following strangeness (python 2.6.2): getattr(int, '__gt__') getattr(5, '__gt__') Traceback (most recent call last):n File "", line 1, in AttributeError: 'int' object has no attribute '__gt__' Is this a bug ? I believe that ints in the 2.x ser

numpy f2py question

2009-10-02 Thread George Trojan
I have a problem with numpy's vectorize class and f2py wrapped old FORTRAN code. I found that the function _get_nargs() in site-packages/numpy/lib/function_base.py tries to find the number of arguments for a function from an error message generated when the function is invoked with no arguments

Re: epydoc - can I provide multiple dirs to parse

2009-10-02 Thread Jonathan Gardner
On Oct 2, 11:38 am, Medi wrote: > Can I present multiple directories to epydoc to process. For example > > epydoc -option -option -option dir_1 dir_2 dir_3 > I know nothing of epydoc. However, it looks like it should be something like: epydoc -option dir_1 -option dir_2 -option dir_3 ...if a

Re: store encrypted data in sqlite ?

2009-10-02 Thread Carsten Haese
Stef Mientki wrote: > hello, > > I want to store some fields in an sqlite database. > > I use ezPyCrypto to encrypt and decrypt: > > User = ['z684684', 'Mientki, Stef', 1,1,0,1,1 ] > > encryption_key_1 = ezPyCrypto.key ( 512 ) > > SQL_Base = 'insert or replace into __USERS__ values (' > for fi

Re: store encrypted data in sqlite ?

2009-10-02 Thread Jonathan Gardner
On Oct 2, 11:53 am, Stef Mientki wrote: > > Will this method work always ? > Are there better methods ? > I SQLite doesn't like raw data (with all its \0 glory), you're out of luck, unfortunately. Base64 encoding is a really good solution for places like this. You are aware, of course, of the da

RELEASED Python 2.6.3

2009-10-02 Thread Barry Warsaw
On behalf of the Python community, I'm happy to announce the availability of Python 2.6.3. This is the latest production-ready version in the Python 2.6 series. Somewhere near 100 bugs have been fixed since Python 2.6.2 was released in April 2009. Please see the NEWS file for all the gor

Re: Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Duncan Booth
Philip Semanchuk wrote: > In your Pythonic opinion, should 3rd-party modules that live alongside > homegrown code be listed in import category 2 or 3? > PEP 8 also starts by saying "This document gives coding conventions for the Python code comprising the standard library in the main Python

store encrypted data in sqlite ?

2009-10-02 Thread Stef Mientki
hello, I want to store some fields in an sqlite database. I use ezPyCrypto to encrypt and decrypt: User = ['z684684', 'Mientki, Stef', 1,1,0,1,1 ] encryption_key_1 = ezPyCrypto.key ( 512 ) SQL_Base = 'insert or replace into __USERS__ values (' for field in User : SQL += ",'" + encryption_k

Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Philip Semanchuk
Hi all, Our project uses some libraries that were written by 3rd parties (i.e. not us). These libraries fit into a single Python file and live in our source tree alongside other modules we've written. When our app is distributed, they'll be included in the installation. In other words, the

Re: Threaded GUI slowing method execution?

2009-10-02 Thread Dave Angel
(you responded off-list, which isn't the way these mailing lists work. So I'm pasting your message back to the list, with my response at the end) Aaron Hoover wrote: But as soon as you have two threads doing "busy work," instead of them getting 50% each, the threading overhead goes way up,

Re: AJAX Widget Framework

2009-10-02 Thread Aaron Watters
On Oct 1, 2:01 pm, Laszlo Nagy wrote: > I'm looking for an open source, AJAX based widget/windowing framework. > Here is what I need: > > - end user opens up a browser, points it to a URL, logs in > - on the server site, sits my application, creating a new session for > each user that is logged in

Re: Simple Python struct issue

2009-10-02 Thread Simon Forman
On Fri, Oct 2, 2009 at 12:35 PM, Carlo DiCelico wrote: > On Oct 2, 12:15 pm, Simon Forman wrote: >> On Fri, Oct 2, 2009 at 12:07 PM, Carlo DiCelico >> wrote: >> > I saw an article on O'Reilly about using NumPy and Dislin to analyze >> > and visualize WAV files. It's a really fantastic article bu

Re: Fast decimal arithmetic module released

2009-10-02 Thread Mark Dickinson
On Oct 2, 8:53 pm, Stefan Krah wrote: > Hi, > > today I have released the following packages for fast arbitrary precision > decimal arithmetic: > [...] Nice! I'd been wondering how you'd been finding all those decimal.py bugs. Now I know. :) -- Mark -- http://mail.python.org/mailman/listinfo

Re: Regular expression to structure HTML

2009-10-02 Thread 504cr...@gmail.com
Screw: >>> html = """ 14313 Python Hammer Institute #2 Jefferson 70114 8583 New Screwdriver Technical Academy, Inc #4 Jefferson 70114 9371 Career RegEx Center Jefferson

Re: Threaded GUI slowing method execution?

2009-10-02 Thread sturlamolden
On 2 Okt, 20:19, Ole Streicher wrote: > I *do* worry about speed. And I use Python. Why not? There are powerful > libraries available. I do as well. But "powerful libraries" should release the GIL. Let me rephrase that: I am not worried about speed in the part of my code that uses Python. > Us

epydoc - can I provide multiple dirs to parse

2009-10-02 Thread Medi
Can I present multiple directories to epydoc to process. For example epydoc -option -option -option dir_1 dir_2 dir_3 where dir_i is a directory containing some python src codes ? I am currently running it on two directories with about 10M + 20 Meg which takes a very long time (more than 40 minu

Re: The Python: Rag October issue available

2009-10-02 Thread steven.oldner
On Oct 2, 11:14 am, Bernie wrote: > The Python: Rag October issue available > > The October issue of The Python: Rag is available at: > > http://www.pythonrag.org > > A monthly, free, community run, Python magazine - issues are in pdf > format, intended for anyone interested in Python, without bei

Re: Threaded GUI slowing method execution?

2009-10-02 Thread sturlamolden
On 2 Okt, 02:51, Aaron Hoover wrote: > All the thread is doing most of the time is sitting around checking   > the serial port for waiting data, reading it, and appending it to a   > list when it finds it. Do your threads ever block waiting for I/O? If they do, is the GIL released while they are

Python SSL Client Authentication

2009-10-02 Thread AJ Mayorga
I have been able to use the ssl module in Python 2.6 to setup a server that requires The client to authenticate via an x509 certificates, but I want to be able to override the client Authentication process or catch the exception so that I can do redirects etc. if the client authentication Fails.

Re: Threaded GUI slowing method execution?

2009-10-02 Thread Ole Streicher
sturlamolden writes: > On 2 Okt, 13:29, Dave Angel wrote: > If you are worried about speed, chances are you are not using Python > anyway. I *do* worry about speed. And I use Python. Why not? There are powerful libraries available. > If you still have "need for speed" on a multicore, you can us

Fast decimal arithmetic module released

2009-10-02 Thread Stefan Krah
Hi, today I have released the following packages for fast arbitrary precision decimal arithmetic: 1. libmpdec Libmpdec is a C (C++ ready) library for arbitrary precision decimal arithmetic. It is a complete implementation of Mike Cowlishaw's General Decimal Arithmetic specificati

Re: Threaded GUI slowing method execution?

2009-10-02 Thread sturlamolden
On 2 Okt, 13:29, Dave Angel wrote: > Many people have concluded that (in Python) much of what threads are > used for should be done with processes. Remember that threads were invented long before multi-core CPUs were common. Java had threads before the VM could support more than one CPU. The ear

Re: M2Crypto 0.20.1 won't build on Red Hat Linux

2009-10-02 Thread John Nagle
Heikki Toivonen wrote: John Nagle wrote: The right question is "uname --hardware-platform". That returns "i386" if running on something emulating a 386, even it it's 64-bit capable. Thanks, I'll make a note that I'll need to clarify that part. With that change, the build runs to completion

Re: Simple Python struct issue

2009-10-02 Thread MRAB
Carlo DiCelico wrote: I saw an article on O'Reilly about using NumPy and Dislin to analyze and visualize WAV files. It's a really fantastic article but was a little out of date. I updated the script to work with the newer modules &etc but am still having trouble getting it working. The line tem

Re: Simple Python struct issue

2009-10-02 Thread Carlo DiCelico
On Oct 2, 12:15 pm, Simon Forman wrote: > On Fri, Oct 2, 2009 at 12:07 PM, Carlo DiCelico > > > > > > wrote: > > I saw an article on O'Reilly about using NumPy and Dislin to analyze > > and visualize WAV files. It's a really fantastic article but was a > > little out of date. I updated the script

Re: re.sub do not replace portion of match

2009-10-02 Thread J Wolfe
Thanks Duncan, I did look at that, but it was kinda greek to me. Thanks for pulling out the part I was looking for that should do the trick. Jonathan > http://www.python.org/doc/current/library/re.html#re.sub > > > Backreferences, such as \6, are replaced with the substring matched by > > group

Re: Simple Python struct issue

2009-10-02 Thread Simon Forman
On Fri, Oct 2, 2009 at 12:07 PM, Carlo DiCelico wrote: > I saw an article on O'Reilly about using NumPy and Dislin to analyze > and visualize WAV files. It's a really fantastic article but was a > little out of date. I updated the script to work with the newer > modules &etc but am still having tr

Simple Python struct issue

2009-10-02 Thread Carlo DiCelico
I saw an article on O'Reilly about using NumPy and Dislin to analyze and visualize WAV files. It's a really fantastic article but was a little out of date. I updated the script to work with the newer modules &etc but am still having trouble getting it working. The line temp[i,:] = array(struct.un

Re: int rich comparisons

2009-10-02 Thread Mark Dickinson
On Oct 2, 3:52 pm, George Sakkis wrote: > I stumbled upon the following strangeness (python 2.6.2): > > >>> getattr(int, '__gt__') > > > > >>> getattr(5, '__gt__') > > Traceback (most recent call last):n >   File "", line 1, in > AttributeError: 'int' object has no attribute '__gt__' > > Is this

Re: weak reference to bound method

2009-10-02 Thread Ole Streicher
Hi Peter, Peter Otten <__pete...@web.de> writes: I am a bit surprised that already such a simple problem is virtually unsolvable in python. > Btw, have you implemented such a design in another language? No. > I think I'd go for a simpler approach, manage the lifetime of MyClass > i

question about the GC implementation

2009-10-02 Thread Francis Moreau
Hello, I'm looking at gcmodule.c and in move_unreachable() function, the code assumes that if an object has its gc.gc_refs stuff to 0 then it *may* be unreachable. How can an object tagged as unreachable could suddenly become reachable later ? Thanks -- http://mail.python.org/mailman/listinfo/p

Re: Concurrent threads to pull web pages?

2009-10-02 Thread exarkun
On 05:48 am, wlfr...@ix.netcom.com wrote: On Fri, 02 Oct 2009 01:33:18 -, exar...@twistedmatrix.com declaimed the following in gmane.comp.python.general: There's no need to use threads for this. Have a look at Twisted: http://twistedmatrix.com/trac/ Strange... While I can easil

Re: AJAX Widget Framework

2009-10-02 Thread Daniel Fetchinson
> I'm looking for an open source, AJAX based widget/windowing framework. > Here is what I need: > > - end user opens up a browser, points it to a URL, logs in > - on the server site, sits my application, creating a new session for > each user that is logged in > - on the server site, I create windo

int rich comparisons

2009-10-02 Thread George Sakkis
I stumbled upon the following strangeness (python 2.6.2): >>> getattr(int, '__gt__') >>> getattr(5, '__gt__') Traceback (most recent call last):n File "", line 1, in AttributeError: 'int' object has no attribute '__gt__' Is this a bug ? George -- http://mail.python.org/mailman/listinfo/pyt

Re: Regular expression to structure HTML

2009-10-02 Thread Brian D
The other thought I had was that I may not be properly trapping the end of the first row, and the beginning of the next row. On Oct 2, 8:38 am, John wrote: > On Oct 2, 1:10 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote: > > > > > I'm kind of new to regular expressions, and I've spent hou

Re: Regular expression to structure HTML

2009-10-02 Thread Brian D
Yes, John, that's correct. I'm trying to trap and discard the row elements, re-formatting with pipes so that I can more readily import the data into a database. The tags are, of course, initially useful for pattern discovery. But there are other approaches -- I could just replace the tags and cap

Re: Q: sort's key and cmp parameters

2009-10-02 Thread Scott David Daniels
Paul Rubin wrote: I still have never understood why cmp was removed. Sure, key is more convenient a lot (or maybe most) of the time, but it's not always. Not just more convenient. cmp will always be N log N, in that _every_ comparison runs your function, while key is linear, in that it is run

Re: Timestamps for TCP packets?

2009-10-02 Thread Grant Edwards
On 2009-10-02, Thomas Johnson wrote: > Is there any way to get kernel-level timestamps for TCP packets while > still using the standard python sockets library for communication? libpcap http://sourceforge.net/projects/pylibpcap/ > I need to communicate over a TCP connection as easily as > poss

Re: Regular expression to structure HTML

2009-10-02 Thread John
On Oct 2, 1:10 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote: > I'm kind of new to regular expressions, and I've spent hours trying to > finesse a regular expression to build a substitution. > > What I'd like to do is extract data elements from HTML and structure > them so that they can more

Re: weak reference to bound method

2009-10-02 Thread Peter Otten
Ole Streicher wrote: > Hi Peter, > > Peter Otten <__pete...@web.de> writes: >> Ole Streicher wrote: >>> Peter Otten <__pete...@web.de> writes: > What I want is to have a universal class that "always" works: with > unbound functions, with bound function, with lambda expressions, with >

Re: weak reference to bound method

2009-10-02 Thread Ole Streicher
Hi Peter, Peter Otten <__pete...@web.de> writes: > class Method(object): > def __init__(self, obj, func=None): > if func is None: > func = obj.im_func > obj = obj.im_self This requires that func is a bound method. What I want is to have a universal class that "

PyCon 2010

2009-10-02 Thread baboucarr sanneh
Hi Guys...want to register to the PyCon 2010 conference but i cannot have access to the page because it says the page was not found on the server..I have seen also that they can give out financial aid for those who want to go to the conference.am interested in that too as it will be very expens

Re: weak reference to bound method

2009-10-02 Thread Ole Streicher
Hi Peter, Peter Otten <__pete...@web.de> writes: > Ole Streicher wrote: >> Peter Otten <__pete...@web.de> writes: What I want is to have a universal class that "always" works: with unbound functions, with bound function, with lambda expressions, with locally defined functions, >>> T

ANN: Humerus 2.1

2009-10-02 Thread Greg Ewing
Humerus 2.1 is now available: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/Humerus-2.1.0.zip Online documentation: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/Humerus-2.1.0/doc/ In this version, the code for handling levels has been separated out into a new pair

Re: Regular expression to structure HTML

2009-10-02 Thread Stefan Behnel
Paul McGuire wrote: > On Oct 2, 12:10 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote: >> I'm kind of new to regular expressions, and I've spent hours trying to >> finesse a regular expression to build a substitution. >> >> What I'd like to do is extract data elements from HTML and structure >>

Re: easy question, how to double a variable

2009-10-02 Thread Chris Colbert
I come from a scientific background, so my approach to the solution of this problem is a little different. It makes use of some numerical approximations, but that's not necessarily a bad thing, because it helps avoid singularities. So it could be a little more robust than other solutions presented

Re: weak reference to bound method

2009-10-02 Thread Peter Otten
Ole Streicher wrote: > Hello Peter, > > Peter Otten <__pete...@web.de> writes: >>> What I want is to have a universal class that "always" works: with >>> unbound functions, with bound function, with lambda expressions, with >>> locally defined functions, > >> That's left as an exercise to the re

RE: New Python Novice

2009-10-02 Thread baboucarr sanneh
Thanks Deven... Appreciate it $LIM $...@dy Date: Fri, 2 Oct 2009 17:37:28 +0530 Subject: Re: New Python Novice From: drt...@gmail.com To: sanne...@hotmail.com CC: python-list@python.org On Fri, Oct 2, 2009 at 4:34 PM, baboucarr sanneh wrote: Hello Everyone, My name is Baboucarr ..a

Re: New Python Novice

2009-10-02 Thread Deven T
On Fri, Oct 2, 2009 at 4:34 PM, baboucarr sanneh wrote: > Hello Everyone, > > My name is Baboucarr ..am from the gambia (west africa)..I just read about > python and i want to know how to program with it.. > I would like you guys to help me in my road to becoming a python guru..Am a > novice so i

RE: New Python Novice

2009-10-02 Thread baboucarr sanneh
Thanks simon, Can't wait to get my hands dirty on it.. $LIM $...@dy > From: si...@brunningonline.net > Date: Fri, 2 Oct 2009 12:32:53 +0100 > Subject: Re: New Python Novice > To: sanne...@hotmail.com > CC: python-list@python.org > > 2009/10/2 baboucarr sanneh : > > Hello Everyone, > > > > My

Re: weak reference to bound method

2009-10-02 Thread Ole Streicher
Hello Peter, Peter Otten <__pete...@web.de> writes: >> What I want is to have a universal class that "always" works: with >> unbound functions, with bound function, with lambda expressions, with >> locally defined functions, > That's left as an exercise to the reader ;) Do you have the feeling t

Re: weak reference to bound method

2009-10-02 Thread Peter Otten
Ole Streicher wrote: > Peter Otten <__pete...@web.de> writes: >> class Method(object): >> def __init__(self, obj, func=None): >> if func is None: >> func = obj.im_func >> obj = obj.im_self > > This requires that func is a bound method. What I want is to have a

Re: Q: sort's key and cmp parameters

2009-10-02 Thread Duncan Booth
Paul Rubin wrote: > Duncan Booth writes: >> > Is there a real-life sorting task that requires (or is far more >> > efficient with) cmp and can't be easily achieved with key and reverse? >> > >> There is no sorting task that *requires* cmp. If all else fails you can

Re: New Python Novice

2009-10-02 Thread Simon Brunning
2009/10/2 baboucarr sanneh : > Hello Everyone, > > My name is Baboucarr ..am from the gambia (west africa).. I visited some years back. Friendly people. > I just read about > python and i want to know how to program with it.. > I would like you guys to help me in my road to becoming a python guru

Re: Threaded GUI slowing method execution?

2009-10-02 Thread Dave Angel
Aaron Hoover wrote: I have a wx GUI application that connects to a serial port in a separate thread, reads from the port, and then is supposed to put the data it finds into a queue to be used by the main GUI thread. Generally speaking, it's working as expected. However, one method (that's pa

New Python Novice

2009-10-02 Thread baboucarr sanneh
Hello Everyone, My name is Baboucarr ..am from the gambia (west africa)..I just read about python and i want to know how to program with it.. I would like you guys to help me in my road to becoming a python guru..Am a novice so i would welcome any suggestions etc.. Will be posting again soon.Th

Re: easy question, how to double a variable

2009-10-02 Thread Albert van der Horst
In article , daggerdvm wrote: >you brain needs error checking! Whose brain? At least I know this: Your brain is beyond repair. Go for a brain transplant. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe

setuptools, accessing ressource files

2009-10-02 Thread Patrick Sabin
I use setuptools to create a package. In this package I included some images and I checked that they are in the egg-file. The problem is how can I access the images in the package? I tried pkgutil.get_data, but only got an IOError, because the EGG-INFO directory doesn't exist. I tried pkg_re

Re: Python and lost files

2009-10-02 Thread Dave Angel
Carl Banks wrote: On Sep 30, 11:35 pm, "Timothy W. Grove" wrote: Recently I purchased some software to recover some files which I had lost. (A python project, incidentally! Yes, I should have kept better backups!) They were nowhere to found in the file system, nor in the recycle bin, but thi

Re: weak reference to bound method

2009-10-02 Thread Thomas Lehmann
> I am trying to use a weak reference to a bound method: > > class MyClass(object): > def myfunc(self): > pass > > o = MyClass() > print o.myfunc > > > > import weakref > r = weakref.ref(o.myfunc) > print r() > None > > This is what I do not understand. The object "o" is s

Re: weak reference to bound method

2009-10-02 Thread Ole Streicher
Hi Miles, Miles Kaufmann writes: > You could also create a wrapper object that holds a weak reference to the > instance and creates a bound method on demand: > class WeakMethod(object): > def __init__(self, bound_method): > self.im_func = bound_method.im_func > self.im_self =

Re: cx_freeze problem on Ubuntu

2009-10-02 Thread Paul Boddie
On 1 Okt, 16:08, John wrote: > > I downloaded the cx_freeze source code > fromhttp://cx-freeze.sourceforge.net/into a directory. [...] >  From > here:http://linux.softpedia.com/get/Programming/Assembler-Tools/cx-Freeze-... > the directions state: What about the documentation available from th

Re: weak reference to bound method

2009-10-02 Thread Peter Otten
Ole Streicher wrote: > Hi Thomas, > > Thomas Lehmann writes: >>> r = weakref.ref(o.myfunc) >>> print r() >>> None >> k = o.myfunc >> r = weakref.ref(k) >> print r() >>> > >> Don't ask me why! I have just been interested for what you are trying... > > This is clear: in your case, o

Re: weak reference to bound method

2009-10-02 Thread Ole Streicher
Hello Peter, Peter Otten <__pete...@web.de> writes: > Is there an actual use case? I discussed this in the german newsgroup. Here is the use in my class: -8<--- import threading import weakref class DoAsync(threading.Thread): def __init__(self,

Re: weak reference to bound method

2009-10-02 Thread Miles Kaufmann
On Oct 2, 2009, at 1:54 AM, Ole Streicher wrote: I am trying to use a weak reference to a bound method: class MyClass(object): def myfunc(self): pass o = MyClass() print o.myfunc 0xc675d0>> import weakref r = weakref.ref(o.myfunc) print r() None This is what I do not understand

Re: custom data warehouse in python vs. out-of-the-box ETL tool

2009-10-02 Thread M.-A. Lemburg
Tony Schmidt wrote: > Hi, Marc-Andre - well, so far you seem to be the only one suggesting > that cross-database joins is the way to go - everyone else has been > telling me to build a warehouse. I initially was trying to avoid the > warehouse idea to "avoid going through the external temporary >

Re: weak reference to bound method

2009-10-02 Thread Ole Streicher
Hi Thomas, Thomas Lehmann writes: >> r = weakref.ref(o.myfunc) >> print r() >> None > k = o.myfunc > r = weakref.ref(k) > print r() >> > Don't ask me why! I have just been interested for what you are trying... This is clear: in your case, o.myfunc is explicitely referenced by k, th

  1   2   >