External code and functions integration

2008-09-22 Thread Cro
Good day. I am using python for quite some time now and i decided to advance a little. I want to write a little extension, or add some C modules for my python. I use Active version. What i want to do is write some wrappers for a game library, called HGE. See "hge.relishgames.com". I wrote some ap

Re: External code and functions integration

2008-09-22 Thread Diez B. Roggisch
Cro schrieb: Good day. I am using python for quite some time now and i decided to advance a little. I want to write a little extension, or add some C modules for my python. I use Active version. What i want to do is write some wrappers for a game library, called HGE. See "hge.relishgames.com".

Re: understanding list scope

2008-09-22 Thread mbezzi
On Sep 21, 7:48 pm, Peter Pearson <[EMAIL PROTECTED]> wrote: > FWIW, since I started following this newsgroup, I've noticed > that I no longer have those crises that revolve around the depth > of a copy.  I conjecture that they resulted from non-pythonic > style.  Try following this newsgroup for

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Rhamphoryncus
On Sep 21, 4:39 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I have a class which is not intended to be instantiated. Instead of using > the class to creating an instance and then operate on it, I use the class > directly, with classmethods. Essentially, the class is used as

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread Arnaud Delobelle
On 22 Sep, 04:05, josh logan <[EMAIL PROTECTED]> wrote: > Hello, > > I have 2 questions. Say I have this class: > > class Player(object): > def __init__(self, fname, lname, score): > self.score = score > self.fname = fname > self.lname = lname > def __cmp__(self, oth

Re: Python newbie question re Strings and integers

2008-09-22 Thread Bruno Desthuilliers
rmac a écrit : Ah! Arghh!!! You are so correct on the usage of the ':' Python syntax is a little different from what I am used to. I don't know what you're used to, but chances are that more than the syntax differs !-) -- http://mail.python.org/mailman/listinfo/python-list

matrix algebra

2008-09-22 Thread Al Kabaila
Hi, My OS is Linux (openSUSE 10.3) and my interest in retirement is Python applications to Structural Analysis of Civil Engineering structures, currently in 2 dimensions only (under GPL). Modern Structural Analysis is highly matrix oriented, but requires only a few basic matrix operations, namely

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : I have a class which is not intended to be instantiated. Instead of using the class to creating an instance and then operate on it, I use the class directly, with classmethods. Essentially, the class is used as a function that keeps state from one call to the next. T

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Steven D'Aprano
On Mon, 22 Sep 2008 10:12:38 +1000, James Mills wrote: > On Mon, Sep 22, 2008 at 9:39 AM, Calvin Spealman <[EMAIL PROTECTED]> > wrote: >> I call it an obvious misuse and misunderstanding of why you'd use a >> class in the first place. Either create an instance and not make these >> things classmet

A bit weird dictionary behavior

2008-09-22 Thread Pekka Laukkanen
Hello, just noticed this: Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> {1: 2} {1: 2} >>> {True: False} {True: False} >>> {1: 2, True: False} {1: False} This must be becaus

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I don't want the objects to share state. I'm not exactly sure what I > said that has given so many people the impression that I do. This: Steven D'Aprano <[EMAIL PROTECTED]> writes: > Essentially, the class is used as a function that keeps state fr

Re: matrix algebra

2008-09-22 Thread Tim Leslie
On Mon, Sep 22, 2008 at 6:02 PM, Al Kabaila <[EMAIL PROTECTED]> wrote: > Hi, > > My OS is Linux (openSUSE 10.3) and my interest in retirement is Python > applications to Structural Analysis of Civil Engineering structures, > currently in 2 dimensions only (under GPL). Modern Structural Analysis is

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Steven D'Aprano
On Mon, 22 Sep 2008 10:11:58 +0200, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : >> I have a class which is not intended to be instantiated. Instead of >> using the class to creating an instance and then operate on it, I use >> the class directly, with classmethods. Essentially, the clas

Re: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

2008-09-22 Thread Gabriel Genellina
En Sun, 21 Sep 2008 19:42:10 -0300, Blubaugh, David A. <[EMAIL PROTECTED]> escribió: Sir, Thank you for your reply. This is as to how I developed my .pyd file. I entered the following commands within my MS-DOS prompt within Windows XP: C:\python25\Scripts> C:\python25\python f2py.py -

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread James Mills
On 22 Sep 2008 09:07:43 GMT, Steven D'Aprano > But that's precisely what I want to avoid: I don't want the objects to > share *any* state, not even their class. I'm not trying for a Borg or > Singleton: the user can call the factory as many times as they want, but > the objects returned shouldn'

Re: A bit weird dictionary behavior

2008-09-22 Thread Arnaud Delobelle
On 22 Sep, 10:25, "Pekka Laukkanen" <[EMAIL PROTECTED]> wrote: > Hello, > > just noticed this: > > Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > Type "help", "copyright", "credits" or "license" for more information.>>> {1: > 2} > {1: 2} > >>> {T

BadStatusLine:

2008-09-22 Thread noelob
Hi All, During performance testing of my web application, I occasionally get a BadStatusLine exception from httplib. Reading http://docs.python.org/lib/module-httplib.html#l2h-4021 tells me that it's "Raised if a server responds with a HTTP status code that we don't understand." Is there a way to

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Mon, 22 Sep 2008 10:11:58 +0200, Bruno Desthuilliers wrote: Steven D'Aprano a écrit : I have a class which is not intended to be instantiated. Instead of using the class to creating an instance and then operate on it, I use the class directly, with classmethods. Es

Re: BadStatusLine:

2008-09-22 Thread Bruno Desthuilliers
noelob a écrit : Hi All, During performance testing of my web application, I occasionally get a BadStatusLine exception from httplib. Reading http://docs.python.org/lib/module-httplib.html#l2h-4021 tells me that it's "Raised if a server responds with a HTTP status code that we don't understand."

imagefap showfavorites - Free

2008-09-22 Thread uomiocenekidd
imagefap showfavorites . . . ***CLICK HERE http://vids365.cn/imagefap-showfavorites * . . . . . . . . . . . . imagefap showfavorites -- http://mail.python.org/mailman/listinfo/python-list

www amateurgalore net - Free

2008-09-22 Thread uomiocenekidd
www amateurgalore net . . . ***CLICK HERE http://vids365.cn/www-amateurgalore-net * . . . . . . . . . . . . www amateurgalore net -- http://mail.python.org/mailman/listinfo/python-list

redtube xtube youporn - Free

2008-09-22 Thread uomiocenekidd
redtube xtube youporn . . . ***CLICK HERE http://vids365.cn/redtube-xtube-youporn * . . . . . . . . . . . . redtube xtube youporn -- http://mail.python.org/mailman/listinfo/python-list

download from redtube - Free

2008-09-22 Thread uomiocenekidd
download from redtube . . . ***CLICK HERE http://vids365.cn/download-from-redtube * . . . . . . . . . . . . download from redtube -- http://mail.python.org/mailman/listinfo/python-list

www shockingtube com - Free

2008-09-22 Thread uomiocenekidd
www shockingtube com . . . ***CLICK HERE http://vids365.cn/www-shockingtube-com * . . . . . . . . . . . . www shockingtube com -- http://mail.python.org/mailman/listinfo/python-list

Re: New Web2Py framework SLASHES development time...

2008-09-22 Thread Paul Boddie
On 22 Sep, 04:49, Steve Shephed <[EMAIL PROTECTED]> wrote: > http://www.web2py.comWeb2Py - Python Framework is the newest > kid on the block for Python frameworks. I'm not going to dwell on the merits of web2py, I'm afraid... > It has a lot of features that simply are not there in other > framewo

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Tim Rowe
2008/9/22 Bruno Desthuilliers <[EMAIL PROTECTED]>: > Steven D'Aprano a écrit : >> >> On Mon, 22 Sep 2008 10:11:58 +0200, Bruno Desthuilliers wrote: >> >>> Steven D'Aprano a écrit : I have a class which is not intended to be instantiated. Instead of using the class to creating an inst

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread Peter Otten
josh logan wrote: > A better example would be sorting by increasing last name and > decreasing first name. This would be easy with the sort function > comparator, but I can't see how to do the same with the key argument. > Is the only solution to decorate the Player objects in another class > that

Re: dict generator question

2008-09-22 Thread bearophileHUGS
Steven D'Aprano: >Extending len() to support iterables sounds like a good idea, except that it's >not.< Python language lately has shifted toward more and more usage of lazy iterables (see range lazy by default, etc). So they are now quite common. So extending len() to make it act like leniter()

Encoding.ASCII.GetBytes similar for Python ?

2008-09-22 Thread Rui
Hi, how can i do what Encoding.ASCII.GetBytes (in .net, c#) does with the strings. I am trying to query some dns server to check its response using udp sockets. Some of the source below: # encoding: utf8 import socket import sys import struct IP_PORT = 53 server_host = ('4.2.2.1', IP_PORT) transa

Re: BadStatusLine:

2008-09-22 Thread Diez B. Roggisch
noelob wrote: > Hi All, > > During performance testing of my web application, I occasionally get a > BadStatusLine exception from httplib. Reading > http://docs.python.org/lib/module-httplib.html#l2h-4021 tells me that > it's "Raised if a server responds with a HTTP status code that we > don't un

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread josh logan
On Sep 22, 3:41 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On 22 Sep, 04:05, josh logan <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I have 2 questions. Say I have this class: > > > class Player(object): > >     def __init__(self, fname, lname, score): > >         self.score = score > >

Re: A bit weird dictionary behavior

2008-09-22 Thread bearophileHUGS
Pekka Laukkanen: > but it still doesn't feel exactly right. Would it be worth submitting a bug? It feels wrong because it is. In a tidier language (Pascal, Java, etc) a boolean and an integer must be different types. Keeping booleans and integers separated may avoid some bugs too (I don't know how

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread Sion Arrowsmith
josh logan <[EMAIL PROTECTED]> wrote: >sorted(P) # throws TypeError: unorderable types Player() < Player() > >The sorted function works when I define __lt__. >I must be misreading the documentation, because I read for the >documentation __cmp__ that it is called if none of the other rich >comparis

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Bruno Desthuilliers
Tim Rowe a écrit : 2008/9/22 Bruno Desthuilliers <[EMAIL PROTECTED]>: Steven D'Aprano a écrit : On Mon, 22 Sep 2008 10:11:58 +0200, Bruno Desthuilliers wrote: Steven D'Aprano a écrit : I have a class which is not intended to be instantiated. Instead of using the class to creating an instance

Re: Encoding.ASCII.GetBytes similar for Python ?

2008-09-22 Thread Tino Wildenhain
Hi, Rui wrote: Hi, how can i do what Encoding.ASCII.GetBytes (in .net, c#) does with the strings. I am trying to query some dns server to check its What would it do? response using udp sockets. Some of the source below: # encoding: utf8 import socket import sys import struct IP_PORT = 53 s

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread Arnaud Delobelle
On 22 Sep, 11:52, josh logan <[EMAIL PROTECTED]> wrote: > On Sep 22, 3:41 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > > On 22 Sep, 04:05, josh logan <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > I have 2 questions. Say I have this class: > > > > class Player(object): > > > def _

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Arnaud Delobelle
On 22 Sep, 10:32, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > but it isn't good enough if the function needs to refer to it's own > state, because functions can only refer to themselves by name and the > factory can't know what name the function will be bound to. > > As far as I know, the only ob

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread josh logan
On Sep 22, 7:32 am, Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > josh logan  <[EMAIL PROTECTED]> wrote: > > >sorted(P) # throws TypeError: unorderable types Player() < Player() > > >The sorted function works when I define __lt__. > >I must be misreading the documentation, because I read for the > >

Re: Encoding.ASCII.GetBytes similar for Python ?

2008-09-22 Thread Marc 'BlackJack' Rintsch
On Mon, 22 Sep 2008 04:23:09 -0700, Rui wrote: > Hi, how can i do what Encoding.ASCII.GetBytes (in .net, c#) does with > the strings. I am trying to query some dns server to check its response > using udp sockets. Some of the source below: > > # encoding: utf8 > import socket > import sys > impor

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread Hrvoje Niksic
josh logan <[EMAIL PROTECTED]> writes: > sorted(P) # throws TypeError: unorderable types Player() < Player() > > The sorted function works when I define __lt__. > I must be misreading the documentation, because I read for the > documentation __cmp__ that it is called if none of the other rich > co

Re: matrix algebra

2008-09-22 Thread Michael Palmer
On Sep 22, 4:02 am, Al Kabaila <[EMAIL PROTECTED]> wrote: > This is a very active newsgroup that incudes such giants as Frederik Lundh He looks rather small to me in this picture: http://www.python.org/~guido/confpix/flundh-2.jpg -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Tim Rowe
2008/9/22 Bruno Desthuilliers <[EMAIL PROTECTED]>: >> Sounds to me like a functor, aka a function object: >> http://en.wikipedia.org/wiki/Function_object >> > > Ok, then the simple solution is to implement a callable type (__call__ > method), possibly with appropriate support for the descriptor pr

Re: understanding list scope

2008-09-22 Thread Tino Wildenhain
Hi, Alex wrote: Hi all! I have a problem understanding the behaviour of this snippet: data_set = ({"param":"a"},{"param":"b"},{"param":"c"}) for i in range(len(data_set)): ds = data_set[:] data = ds[i] if i == 1: data['param'] = "y" if i == 2: data['param'] = "x" print da

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread josh logan
On Sep 22, 9:29 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > josh logan <[EMAIL PROTECTED]> writes: > > sorted(P) # throws TypeError: unorderable types Player() < Player() > > > The sorted function works when I define __lt__. > > I must be misreading the documentation, because I read for the > >

Re: A bit weird dictionary behavior

2008-09-22 Thread Tino Wildenhain
Hi, [EMAIL PROTECTED] wrote: Pekka Laukkanen: ... On the other hand it has some little practical advantages, you can do: sum(x == y for x in iterable) That also equals to a more tidy: sum(1 for x in iterable if x == y) Wouldn't len([x for x in iterable if x==y]) or even shorter: iterable.

Re: A bit weird dictionary behavior

2008-09-22 Thread bearophileHUGS
Tino Wildenhain: > Wouldn't > len([x for x in iterable if x==y]) > or even shorter: > iterable.count(y) > not work and read better anyway? The first version creates an actual list just to take its length, think about how much memory it may use. The second version requires the 'iterable' object to

Reading Windows CSV file with LCID entries under Linux.

2008-09-22 Thread Thomas Troeger
Dear all, I've stumbled over a problem with Windows Locale ID information and codepages. I'm writing a Python application that parses a CSV file, the format of a line in this file is "LCID;Text1;Text2". Each line can contain a different locale id (LCID) and the text fields contain data that is

Re: Reading Windows CSV file with LCID entries under Linux.

2008-09-22 Thread skip
Thomas> My question is: How can I convert this data into something more Thomas> reasonable like unicode? Basically, what I want is something Thomas> like "Text1;Text2", both fields encoded as UTF-8. Can this be Thomas> done with Python? How can I find out which codepage I have to

Re: Reading Windows CSV file with LCID entries under Linux.

2008-09-22 Thread Tim Golden
Thomas Troeger wrote: I've stumbled over a problem with Windows Locale ID information and codepages. I'm writing a Python application that parses a CSV file, the format of a line in this file is "LCID;Text1;Text2". Each line can contain a different locale id (LCID) and the text fields contain da

Re: A bit weird dictionary behavior

2008-09-22 Thread Tino Wildenhain
Hi, [EMAIL PROTECTED] wrote: Tino Wildenhain: Wouldn't len([x for x in iterable if x==y]) or even shorter: iterable.count(y) not work and read better anyway? The first version creates an actual list just to take its length, think about how much memory it may use. yes it seems len() does no

Top Techniques of Money Making INTERNET CASH MAKING SOLUTIONS

2008-09-22 Thread [EMAIL PROTECTED]
Ultimate Destination For All Online Job Seekers. Online cash online money without investments online paid surveys earn money online. Earn with FUN!!! For More Details Check the Links Below: http://www.tips2internetmarketing.blogspot.com/ http://www.80kpermonth.blogspot.com -- http://mail.python.or

Top Techniques of Money Making INTERNET CASH MAKING SOLUTIONS

2008-09-22 Thread [EMAIL PROTECTED]
Ultimate Destination For All Online Job Seekers. Online cash online money without investments online paid surveys earn money online. Earn with FUN!!! For More Details Check the Links Below: http://www.tips2internetmarketing.blogspot.com/ http://www.80kpermonth.blogspot.com -- http://mail.python.or

Top Techniques of Money Making INTERNET CASH MAKING SOLUTIONS

2008-09-22 Thread [EMAIL PROTECTED]
Ultimate Destination For All Online Job Seekers. Online cash online money without investments online paid surveys earn money online. Earn with FUN!!! For More Details Check the Links Below: http://www.tips2internetmarketing.blogspot.com/ http://www.80kpermonth.blogspot.com -- http://mail.python.or

Re: Why are "broken iterators" broken?

2008-09-22 Thread Fredrik Lundh
Cameron Simpson wrote: you probably want the consumer thread to block when it catches up with the producer, rather than exit. It sounds like he wants non-blocking behaviour in his consumer. Roy gave an example, he didn't post a requirements specification. A common example is "try to gathe

Regex Help

2008-09-22 Thread Support Desk
Anybody know of a good regex to parse html links from html code? The one I am currently using seems to be cutting off the last letter of some links, and returning links like http://somesite.co or http://somesite.ph the code I am using is regex = r'' page_text = urllib.urlopen('http://somesit

Re: Regex Help

2008-09-22 Thread Fredrik Lundh
Support Desk wrote: the code I am using is regex = r'' that's way too fragile to work with real-life HTML (what if the link has a TITLE attribute, for example? or contains whitespace after the HREF?) you might want to consider using a real HTML parser for this task. page_text = urllib.

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 8:45 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/22 Bruno Desthuilliers <[EMAIL PROTECTED]>: > > >> Sounds to me like a functor, aka a function object: > >>http://en.wikipedia.org/wiki/Function_object > > > Ok, then the simple solution is to implement a callable type (__call__ > >

Re: Question about sorted in Python 3.0rc1

2008-09-22 Thread Terry Reedy
josh logan wrote: Here is a minimal example showing the problematic behavior. class Int(): def __init__(self, i): self.i = i def __cmp__(self, other): return cmp(self.i, other.i) Is = [Int(i) for i in range(8)] Is.sort() # throws TypeError: unorderable types Int() < Int

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Matimus
On Sep 21, 3:39 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I have a class which is not intended to be instantiated. Instead of using > the class to creating an instance and then operate on it, I use the class > directly, with classmethods. Essentially, the class is used as

Problems running on hp dual core processor

2008-09-22 Thread jim-on-linux
Python help, I have a number of clients running a program built with python 2.5. One has just purchased an HP with a duel core processor, 2.2G with .099g ram. On the new hp, when they try to print they get an import error; File win32ui.pyc line 12, in File win32ui.pyc, line 10, in _load Imp

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Terry Reedy
Steven D'Aprano wrote: Consider a factory function: def factory(x): # a toy example alist = [x] def foo(): return alist return foo Now suppose we "instantiate" the factory (for lack of a better term): f1 = factory(0) f2 = factory(0) Your factory is returning closures

Problems running on hp dual core processor

2008-09-22 Thread jim-on-linux
Python help, I have a number of clients running a program built with python 2.5. One has just purchased an HP with a duel core processor, 2.2G with .099g ram. On the new hp, when they try to print they get an import error; File win32ui.pyc line 12, in File win32ui.pyc, line 10, in _load Impo

Re: Problems running on hp dual core processor

2008-09-22 Thread Mike Driscoll
On Sep 22, 1:43 pm, jim-on-linux <[EMAIL PROTECTED]> wrote: > Python help, > > I have a number of clients running a program built with > python 2.5.  One has just purchased an HP with a duel > core processor,  2.2G with .099g ram. > > On the new hp, when they try to print they get an > import error

Re: Problems running on hp dual core processor

2008-09-22 Thread Mike Driscoll
On Sep 22, 1:43 pm, jim-on-linux <[EMAIL PROTECTED]> wrote: > Python help, > > I have a number of clients running a program built with > python 2.5.  One has just purchased an HP with a duel > core processor,  2.2G with .099g ram. > > On the new hp, when they try to print they get an > import error

Job queue using xmlrpc and threading

2008-09-22 Thread [EMAIL PROTECTED]
I'm trying to implement an application that will listen for requests, run them when they are present but also be able to add new requests even while it's running. I've tried to do this using the thread and xmlrpc modules - the idea is that an XML-RPC exposed object tell the queue thread object to a

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Bruno Desthuilliers
Aaron "Castironpi" Brady a écrit : On Sep 22, 8:45 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: 2008/9/22 Bruno Desthuilliers <[EMAIL PROTECTED]>: Sounds to me like a functor, aka a function object: http://en.wikipedia.org/wiki/Function_object Ok, then the simple solution is to implement a calla

Re: A bit weird dictionary behavior

2008-09-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Pekka Laukkanen: but it still doesn't feel exactly right. Would it be worth submitting a bug? It feels wrong because it is. In a tidier language (Pascal, Java, etc) a boolean and an integer must be different types. Some would argue (and some did by the time Python

Re: Job queue using xmlrpc and threading

2008-09-22 Thread Jeff
Try using the Queue module - http://docs.python.org/lib/module-Queue.html. Here is a tutorial with it - http://www.artfulcode.net/articles/multi-threading-python/. -- http://mail.python.org/mailman/listinfo/python-list

pyArkansas Set for October 4th

2008-09-22 Thread Greg Lindstrom
This is a reminder of the upcoming pyArkansas one-day Python conference being held on the campus of the University of Central Arkansas on Sat Oct 4, 2008. The schedule is pretty much set ( http://pycamp.python.org/Arkansas/Schedule) and has something for anyone interested in Python, from intro wor

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 2:38 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady a écrit : > > > > > On Sep 22, 8:45 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > >> 2008/9/22 Bruno Desthuilliers <[EMAIL PROTECTED]>: > > Sounds to me like a functor, aka a function object: > http

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Robert Kern
Fredrik Lundh wrote: Mensanator wrote: I'm not the one who wrote sympy, so I guess I'm not the only one who didn't notice it. If it's a well known problem, then sorry I wasted your time. Given that 2.5 explicitly warns about this specific change: >>> as = 1 :1: Warning: 'as' will become a

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Bruno Desthuilliers
Aaron "Castironpi" Brady a écrit : On Sep 22, 2:38 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: (snip) Going back to robot-mode, Aaron ? Not getting the same sense of "soul" as from my usual posts. I guess so. Might even drop the name change, too... Don't !-) while I'm at it. One

Re: Problems running on hp dual core processor

2008-09-22 Thread Christian Heimes
Dennis Lee Bieber wrote: Interesting... The only win32ui* on my machine (running v2.4) is a win32ui.pyd (D, not C) and it is part of the PythonWin IDE obtained as part of the ActiveState installer for windows. Oh, and /how much RAM/? ".099g" sounds rather small; my PDA has ".5G"

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 3:28 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady a écrit : > > > On Sep 22, 2:38 pm, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > (snip) > >> Going back to robot-mode, Aaron ? > > > Not getting the same sense of "soul" as from my usual posts.  I

Tkinter 3000 WCK Install Problem

2008-09-22 Thread garyr
I'm trying to install WCK. I downloaded and installed the Windows executable for my Python version. It appeared to run OK. I then downloaded the demo files but find that none run due to error: ImportError: No module named _tk3draw. I'm using ActivePython 2.3.5 on Windows XP Home. What can I do to f

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Fredrik Lundh
Robert Kern wrote: No warnings show up when importing the offending module: Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from sympy.mpmath import specfun >>>

Re: Tkinter 3000 WCK Install Problem

2008-09-22 Thread Fredrik Lundh
garyr wrote: I'm trying to install WCK. I downloaded and installed the Windows executable for my Python version. It appeared to run OK. I then downloaded the demo files but find that none run due to error: ImportError: No module named _tk3draw. I'm using ActivePython 2.3.5 on Windows XP Home. Wh

a short-cut command for globals().clear() ??

2008-09-22 Thread CapnBearbossa
hi all, forgive me , but the RTFM and Google search approaches are not yielding an answer on this question. I need to know if there's a top level python interpreter command that clears all user variables (not built-ins) from the global namespace. In other words a statement, or some_command_or_fu

Re: A bit weird dictionary behavior

2008-09-22 Thread Carl Banks
On Sep 22, 3:43 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > Pekka Laukkanen: > >> but it still doesn't feel exactly right. Would it be worth submitting a > >> bug? > > > It feels wrong because it is. In a tidier language (Pascal, Java, etc) > > a boolean

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-22 Thread Terry Reedy
Fredrik Lundh wrote: Robert Kern wrote: (if someone wants to submit this to bugs.python.org, be my guest) http://bugs.python.org/issue3936 -- http://mail.python.org/mailman/listinfo/python-list

Re: a short-cut command for globals().clear() ??

2008-09-22 Thread Matimus
On Sep 22, 2:31 pm, [EMAIL PROTECTED] wrote: > hi all, > > forgive me , but the RTFM and Google search approaches are not > yielding an answer on this question.  I need to know if there's a top > level python interpreter command that clears all user variables (not > built-ins) from the global names

python timers and COM/directshow

2008-09-22 Thread Sayanan Sivaraman
Hey all, So I've written a simple video player using directshow/COM in VC++, and I'm in the process of translating it to python. For example, when the avi starts playing, I have a call media_control.Run() , etc. I'm wondering how I should go about updating my gtk.Hscale widget as a trackbar for

Re: Not fully OO ?

2008-09-22 Thread Ricardo Aráoz
Kay Schluehr wrote: > On 20 Sep., 23:07, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > wrote: >> On Sep 20, 3:22 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: >> >> >> >>> On 20 Sep., 18:33, Bruno Desthuilliers >>> <[EMAIL PROTECTED]> wrote: The following definitions are AFAIK the only comm

Re: a short-cut command for globals().clear() ??

2008-09-22 Thread CapnBearbossa
On Sep 22, 5:52 pm, Matimus <[EMAIL PROTECTED]> wrote: > On Sep 22, 2:31 pm, [EMAIL PROTECTED] wrote: > > > > > hi all, > > > forgive me , but the RTFM and Google search approaches are not > > yielding an answer on this question.  I need to know if there's a top > > level python interpreter command

Re: A bit weird dictionary behavior

2008-09-22 Thread Grzegorz Staniak
On 22.09.2008, Carl Banks <[EMAIL PROTECTED]> wroted: >> >> but it still doesn't feel exactly right. Would it be worth submitting a >> >> bug? >> >> > It feels wrong because it is. In a tidier language (Pascal, Java, etc) >> > a boolean and an integer must be different types. >> >> Some would arg

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Steven D'Aprano
On Mon, 22 Sep 2008 19:41:46 +1000, James Mills wrote: > On 22 Sep 2008 09:07:43 GMT, Steven D'Aprano >> But that's precisely what I want to avoid: I don't want the objects to >> share *any* state, not even their class. I'm not trying for a Borg or >> Singleton: the user can call the factory as

Re: a short-cut command for globals().clear() ??

2008-09-22 Thread Terry Reedy
[EMAIL PROTECTED] wrote: forgive me , but the RTFM and Google search approaches are not yielding an answer on this question. I need to know if there's a top level python interpreter command that clears all user variables (not built-ins) from the global namespace. In other words a statement, or

Using vObject

2008-09-22 Thread Joshua Gardner
I'm brand new to USENET so please bear with me. I'm writing a specialized to-do list app. I'm using Django but this is not a question about Django. It has to have recurring tasks set by the managers for the employees to then check off. I've got pretty much everything in the app worked out, except

Python based barcode readers

2008-09-22 Thread Robocop
Does anyone know of any python based barcode readers? I'm looking for something (commercial or open source) that will use some OCR algorithm to read barcodes from an image or ps/pdf file, and ideally will be something along the lines of a callable python script. I have some pretty simple needs, i

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 5:32 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Mon, 22 Sep 2008 19:41:46 +1000, James Mills wrote: > > On 22 Sep 2008 09:07:43 GMT, Steven D'Aprano > >> But that's precisely what I want to avoid: I don't want the objects to > >>  share *any* state, not even t

looper

2008-09-22 Thread Dan Stromberg
I was asked by my employer to publish this a bit ago, so here it is: http://stromberg.dnsalias.org/~dstromberg/looper/ It's a multithreaded script for running n POSIX shell commands m at a time with good error checking. It allows for things like stashing in ssh $hostname or rsync $hostname in

Re: a short-cut command for globals().clear() ??

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 5:44 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > forgive me , but the RTFM and Google search approaches are not > > yielding an answer on this question.  I need to know if there's a top > > level python interpreter command that clears all user variables (not

Re: Python based barcode readers

2008-09-22 Thread Robocop
I also forgot to mention that it need not be nearly as robust as something like Jailhelper 2.0, I will not really need to compensate for noise and irregular conditions. All of my barcodes will be scanned in a predictable, and consistent environment (i.e. a scanner), so all i need is some stupid li

Re: looper

2008-09-22 Thread mobiledreamers
Great thanks On 9/22/08, Dan Stromberg <[EMAIL PROTECTED]> wrote: > > > I was asked by my employer to publish this a bit ago, so here it is: > > http://stromberg.dnsalias.org/~dstromberg/looper/ > > It's a multithreaded script for running n POSIX shell commands m at a > time with good error checki

Re: Python based barcode readers

2008-09-22 Thread mobiledreamers
This is something I have looked for too but I have not come across a decent barcode reader? On 9/22/08, Robocop <[EMAIL PROTECTED]> wrote: > > Does anyone know of any python based barcode readers? I'm looking for > something (commercial or open source) that will use some OCR algorithm > to read b

Re: dict generator question

2008-09-22 Thread Steven D'Aprano
On Mon, 22 Sep 2008 04:21:12 -0700, bearophileHUGS wrote: > Steven D'Aprano: > >>Extending len() to support iterables sounds like a good idea, except >>that it's not.< > > Python language lately has shifted toward more and more usage of lazy > iterables (see range lazy by default, etc). So they

Re: A bit weird dictionary behavior

2008-09-22 Thread Steven D'Aprano
On Mon, 22 Sep 2008 07:35:50 -0700, bearophileHUGS wrote: > Tino Wildenhain: > >> Wouldn't >> len([x for x in iterable if x==y]) >> or even shorter: >> iterable.count(y) >> not work and read better anyway? > > The first version creates an actual list just to take its length, think > about how mu

Re: A bit weird dictionary behavior

2008-09-22 Thread Terry Reedy
Grzegorz Staniak wrote: On 22.09.2008, Carl Banks <[EMAIL PROTECTED]> wroted: Some would argue (and some did by the time Python grew a 'bool' type) that what is wrong is to have a bool type in a language that already have a wider definition of the truth value of an expression... And some woul

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread MRAB
On Sep 22, 11:46 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 22, 5:32 pm, Steven D'Aprano <[EMAIL PROTECTED] > > > > cybersource.com.au> wrote: > > On Mon, 22 Sep 2008 19:41:46 +1000, James Mills wrote: > > > On 22 Sep 2008 09:07:43 GMT, Steven D'Aprano > > >> But that's pr

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 6:55 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Sep 22, 11:46 pm, "Aaron \"Castironpi\" Brady" > > > > <[EMAIL PROTECTED]> wrote: > > On Sep 22, 5:32 pm, Steven D'Aprano <[EMAIL PROTECTED] > > > cybersource.com.au> wrote: > > > On Mon, 22 Sep 2008 19:41:46 +1000, James Mills wrote: > > > >

  1   2   >