Docstrings for class attributes

2008-09-22 Thread Tom Harris
Greetings, I want to have a class as a container for a bunch of symbolic names for integers, eg: class Constants: FOO = 1 BAR = 2 Except that I would like to attach a docstring text to the constants, so that help(Constants.FOO) will print some arbitrary string. Sort of a very limited imp

Re: matrix algebra

2008-09-22 Thread Al Kabaila
Tim Leslie wrote: > There is no need for a wrapper. Both numarray and Numeric have been > deprecated in favour of numpy. Well, some years ago I looked for a matrix package. At that time it looked that numarray was the end of it all - it had a clean syntax, an active developer team. It looked to

Python Fractions issue.

2008-09-22 Thread Paddy
(From: http://paddy3118.blogspot.com/2008/09/python-fractions-issue.html) There seems to be a problem/difference in calculating with the new fractions module when comparing Python 26rc2 and 30rc1 I was reading the paper "Interval Arithmetic: Python Implementation and Applications" and thought to

any tool can shrink DLL?

2008-09-22 Thread oyster
For many external lib, python( and www.freebasic.net) use only the DLL version, whcih is very big often if we want to release our program. So, is there such a tool that can scan a DLL then strip the unused function's code out, so yields a small working DLL? for example, in my program I use only 'c

Re: curses.setsyx()?

2008-09-22 Thread Tim Roberts
[EMAIL PROTECTED] wrote: >On Sep 19, 6:42 pm, [EMAIL PROTECTED] wrote: >> On Sep 19, 1:24 am, Tim Roberts <[EMAIL PROTECTED]> wrote: >> >> > [EMAIL PROTECTED] wrote: >> >> > >I tried curses.setsyx(2,3) in my script and it doesn't move the curses >> > >cursor. Any alternatives/solutions? >> >> > Did

Re: Time.sleep(0.0125) not available within Linux

2008-09-22 Thread Grant Edwards
On 2008-09-23, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > I was wondering if anyone has come across the issue of not being allowed > to have the following within a Python script operating under Linux: > > time.sleep(0.0125) No, I have not. And I doubt anybody else has. > It appears that I

Re: How do I convert a PyObject to string in C++?

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 9:32 pm, [EMAIL PROTECTED] wrote: > I have a PyObject, say 'Hello World' , a string, > How do I convert it to a string in C++? > Thanks in advance! Look at PyString_AsStringAndSize . It gives you a pointer to a buffer and a size. Allocate a new one and copy it if you need to modify it

Re: How do I convert a PyObject to string in C++?

2008-09-22 Thread js
PyString_AsString returns a c string. Just feed it to std::string http://docs.python.org/api/stringObjects.html#l2h-472 On Tue, Sep 23, 2008 at 11:32 AM, <[EMAIL PROTECTED]> wrote: > I have a PyObject, say 'Hello World' , a string, > How do I convert it to a string in C++? > Thanks in advance! >

How do I convert a PyObject to string in C++?

2008-09-22 Thread lixinyi . 23
I have a PyObject, say 'Hello World' , a string, How do I convert it to a string in C++? Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

gplt from scipy missing ?

2008-09-22 Thread Ivan Reborin
I'm relatively new to python. I'm following a tutorial I found on the net, and it uses scipy's gplt for plotting. I installed scipy from their website (win32 installation), numpy also, but when I do from scipy import gplt it gives this error: Traceback (most recent call last): File "", line 1,

Re: A bit weird dictionary behavior

2008-09-22 Thread bearophileHUGS
Steven D'Aprano: >For many iterables, the amount of memory is not excessive and the increase in >readability of len() is to be preferred over the side-effect of sum(1 for...).< With side-effects do you mean the possibility of exhausting a lazy iterable? The readability difference is little, and

Re: Why no tailcall-optimization?

2008-09-22 Thread Michael Palmer
On Sep 22, 9:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? > > I know GvR dislikes some of the functional additions like reduce and > Python is supposedly about "one preferrable way of doing things" but > not being able to use recursion p

Re: dict generator question

2008-09-22 Thread bearophileHUGS
Steven D'Aprano: >I'm sorry, I don't recognise leniter(). Did I miss something?< I have removed the docstring/doctests: def leniter(iterator): if hasattr(iterator, "__len__"): return len(iterator) nelements = 0 for _ in iterator: nelements += 1 return nelements

Time.sleep(0.0125) not available within Linux

2008-09-22 Thread Blubaugh, David A.
To All, I was wondering if anyone has come across the issue of not being allowed to have the following within a Python script operating under Linux: time.sleep(0.0125) It appears that I am not allowed to have the object sleep. Has anyone encountered this specific issue before in the past? T

Re: Not fully OO ?

2008-09-22 Thread Craig Allen
It is clear to me that Python is a multiparadigmed object oriented language. It is clearly possible to write procedural code... that is, Python does not force object oriented syntax or concepts on you and insist you define everything in such a structure. Is the OO it allows full OO, I think so, an

Re: Why no tailcall-optimization?

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 8:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? > > I know GvR dislikes some of the functional additions like reduce and > Python is supposedly about "one preferrable way of doing things" but > not being able to use recursion p

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

2008-09-22 Thread Craig Allen
> Snce when are "users" ever involved > in programming problems or programming > languages ? > since the begining, the first users are programmers, users of your libraries. -- http://mail.python.org/mailman/listinfo/python-list

Why no tailcall-optimization?

2008-09-22 Thread process
Why doesn't Python optimize tailcalls? Are there plans for it? I know GvR dislikes some of the functional additions like reduce and Python is supposedly about "one preferrable way of doing things" but not being able to use recursion properly is just a big pain in the a**. -- http://mail.python.or

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

2008-09-22 Thread MRAB
On Sep 22, 11:07 pm, [EMAIL PROTECTED] wrote: > 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

Re: Python based barcode readers

2008-09-22 Thread Mensanator
On Sep 22, 5:59 pm, Robocop <[EMAIL PROTECTED]> wrote: > 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 consisten

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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: 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()

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

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

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

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

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

  1   2   >