Re: Colored text

2007-08-12 Thread ianaré
On Aug 13, 1:50 am, Rohan <[EMAIL PROTECTED]> wrote: > On Aug 12, 10:01 pm, ianaré <[EMAIL PROTECTED]> wrote: > > > On Aug 12, 10:05 pm, Rohan <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > Can some one tell me how do I get colored text. Say when I want to > > > write something in a text file , ho

Re: decorators - more than just syntactic sugar

2007-08-12 Thread Kay Schluehr
On Aug 11, 8:30 pm, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > How can I find out the predefined decorators? I dare to say that's not easy. Since decorators are just(?) syntactical sugar they don't obtain a particular semantics expressed by distinctive declarative elements. Unlike generators wh

Re: decorators - more than just syntactic sugar

2007-08-12 Thread Michele Simionato
On Aug 11, 8:30 pm, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Hi, > > are decorators more than just syntactic sugar in python 2.x and what > about python 3k ? Well, I argued may times that syntactic sugar is important (all Turing complete languages differs by syntactic sugar only) and having or

Re: is there anybody using __del__ correctly??

2007-08-12 Thread Michele Simionato
On Aug 12, 9:14 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Michele Simionato wrote: > > On Aug 10, 7:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > >> There were also a few recipes posted during this discussion that wrap > >> weakrefs up a bit nicer so it's easier to use them in place of _

Re: Colored text

2007-08-12 Thread Michael Bentley
On Aug 12, 2007, at 7:05 PM, Rohan wrote: > Can some one tell me how do I get colored text. Say when I want to > write something in a text file , how do I get it colored. You can use ANSI escape codes -- http://en.wikipedia.org/wiki/ ANSI_escape_code: colorCodes = [ "\033[0mAll attributes

Re: Colored text

2007-08-12 Thread Rohan
On Aug 12, 10:01 pm, ianaré <[EMAIL PROTECTED]> wrote: > On Aug 12, 10:05 pm, Rohan <[EMAIL PROTECTED]> wrote: > > > Hello, > > Can some one tell me how do I get colored text. Say when I want to > > write something in a text file , how do I get it colored. > > Plain text files don't have color. You

Re: Pausing and Unpausing Threads

2007-08-12 Thread Gabriel Genellina
En Sun, 12 Aug 2007 21:45:47 -0300, Aaron J. M. <[EMAIL PROTECTED]> escribi�: > Uhg, I thought of something I didn't consider before: how to cleanly > end the Server/DirectedControl(l)er process. Use the same Queue; put a special kind of Action, or just a None object, to tell the thread that

Re: Complexity of methods etc

2007-08-12 Thread Paddy
On Aug 13, 1:04 am, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > Hi, > > I was wondering if anyone knew of any resources, where I might be able > to find information about the complexity of certain python functions > or little tips on how to reduce complexity. I mean like the "".join(), > kind of

Re: Querying Graphics Card Name

2007-08-12 Thread Benjamin Goldenberg
On Aug 12, 2:18 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On Thu, 09 Aug 2007 21:58:54 -, Benjamin Goldenberg <[EMAIL PROTECTED]> > wrote: > > On Aug 9, 3:26 pm, Bjoern Schliessmann > [EMAIL PROTECTED]> wrote: > >> Benjamin Goldenberg wrote: > >> > I would like to find out the name of the

Re: Ligmail bug?

2007-08-12 Thread Gabriel Genellina
En Sun, 12 Aug 2007 22:14:08 -0300, Ed Leafe <[EMAIL PROTECTED]> escribi�: > On Aug 12, 2007, at 7:06 AM, Steve Holden wrote: > >> [Please reply via the list when a response is made via the list. > > The default behavior for this list should be to reply to the list, > as you have pointed out

wx.ListBox drag and drop

2007-08-12 Thread ianaré
Hey all, I see plenty of drag and drop examples but they are all for wx.ListCtrl. Anyone know of examples or tutorials for wx.ListBox? Specifically, I would like to be able to drag a selection from one ListBox to another. Thanks in advance, - ianaré -- http://mail.python.org/mailman/listinfo/p

Re: Colored text

2007-08-12 Thread ianaré
On Aug 12, 10:05 pm, Rohan <[EMAIL PROTECTED]> wrote: > Hello, > Can some one tell me how do I get colored text. Say when I want to > write something in a text file , how do I get it colored. Plain text files don't have color. You could output in html ... -- http://mail.python.org/mailman/listin

Re: python + XUL

2007-08-12 Thread Madhu Alagu
On Aug 13, 3:54 am, Luis M. González <[EMAIL PROTECTED]> wrote: > On Aug 12, 3:21 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > > Madhu Alagu wrote: > > > Hi > > > > Python + XUL Success Stories > > > > Thanks > > > > Madhu Alagu > > > Any chance you forgot to ask a question? > > > Stefan > > My

Re: Binary, Hex, and Decimal string conversions

2007-08-12 Thread Dick Moores
At 07:04 PM 8/12/2007, Michael Bentley wrote: >On Aug 12, 2007, at 6:28 PM, Dick Moores wrote: > >>n = 12 >>base = 36 >>print to_base(n, base) >>== >>This seems to work fine for n >= base, but not for n < base. For >>example, the code shown returns "c". Is

Re: Error calling module

2007-08-12 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, fartknuckle wrote: > When I try to call gtk like so: > > > import gtk > > I get the error: > > ImportError: No module named gtk > > > I installed a new Python and a new pygtk. > Is the gtk module not a part of pygtk??? > > I have PYTHONPATH=/usr/local/lib/pyt

Re: question: how to transfer objects between server and client?

2007-08-12 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, OpenPavilion wrote: > just found out, that if I use "pickle.dumps(object)" (on client side) > and "pickle.loads(object)" (on server side) before and after sending, > I have access to the object. That's assuming that the client and server can trust each other. If yo

Re: A dumb question about a class

2007-08-12 Thread Steven Bethard
Steven Bethard wrote: > Dustan wrote: >> On Aug 12, 7:35 pm, Dustan <[EMAIL PROTECTED]> wrote: >>> On Aug 12, 5:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: >>> def iter_primes(): # an iterator of all numbers between 2 and +infinity numbers = itertools.coun

Python script for mobile platforms -- suggested?

2007-08-12 Thread Robert Dailey
Hi, I'm currently developing a game for a cell phone. The game has a GUI system that's currently using XML to define the individual menus. Basically this means that for every single menu the user goes to, it loads and parses an XML file. Would using Python Script instead of XML be a reasonable rep

Re: A dumb question about a class

2007-08-12 Thread Steven Bethard
Dick Moores wrote: > At 03:35 PM 8/12/2007, Steven Bethard wrote: >> Note that if you just want to iterate over all the primes, there's no >> need for the class at all. Simply write:: >> >> for prime in iter_primes(): > > Even if I want to test only 1 integer, or want the list of primes in a

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-12 Thread Erik Max Francis
Peter Otten wrote: > from itertools import imap > > def summit_array(data=data, lookup=lookup): > a = array.array("B") > a.fromstring(data) > return sum(a), sum(imap(lookup.__getitem__, a)) > > $ python -m timeit -s'from summit import summit_array as summit' 'summit()' > 100 loops, b

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-12 Thread Erik Max Francis
Duncan Booth wrote: > I haven't timed it, but at the very least I'd avoid going through all the > data twice: > > count = {} > for i in range(256): > count[chr(i)] = 0 > for x in data: > count[x] += 1 > > ordinalSum = sum(ord(c)*count[c] for c in count) > ordinalSumSquared = sum(ord(c)**2 *

Re: A dumb question about a class

2007-08-12 Thread Steven Bethard
Dustan wrote: > On Aug 12, 7:35 pm, Dustan <[EMAIL PROTECTED]> wrote: >> On Aug 12, 5:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: >> >>> def iter_primes(): >>> # an iterator of all numbers between 2 and +infinity >>> numbers = itertools.count(2) >>> # generate p

Re: which IDE is highly recommended in Windows OS

2007-08-12 Thread _spitFIRE
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ge Chunyuan wrote: > hi Group: > > I am a new comer for Python, I wonder which IDE is recommended in > Windows OS. > Can anyone give some suggestion. > > > Thanks indeed > Ge Chunyuan > - - Stani's Python Editor (http://www.softpedia.com/get/Progr

retrieving ATOM/FSS feeds

2007-08-12 Thread _spitFIRE
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm using feedparser library to parser ATOM/RSS feeds. However, I don't get the entire post! but only summaries! How do I retrieve the entire feed? I believe that the parser library should have support for doing that or the specification should detai

which IDE is highly recommended in Windows OS

2007-08-12 Thread Ge Chunyuan
hi Group: I am a new comer for Python, I wonder which IDE is recommended in Windows OS. Can anyone give some suggestion. Thanks indeed Ge Chunyuan -- http://mail.python.org/mailman/listinfo/python-list

Colored text

2007-08-12 Thread Rohan
Hello, Can some one tell me how do I get colored text. Say when I want to write something in a text file , how do I get it colored. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ligmail bug?

2007-08-12 Thread Steve Holden
Ed Leafe wrote: > On Aug 12, 2007, at 7:06 AM, Steve Holden wrote: > >> [Please reply via the list when a response is made via the list. >> You may >> now have detached the follow-ups from your original question, but at >> least if you use the list there's a chance someone else will help >> yo

Re: Binary, Hex, and Decimal string conversions

2007-08-12 Thread Michael Bentley
On Aug 12, 2007, at 6:28 PM, Dick Moores wrote: n = 12 base = 36 print to_base(n, base) == This seems to work fine for n >= base, but not for n < base. For example, the code shown returns "c". Is my indentation wrong, or the code? It seems to me that

Re: Hex editor - Python beginner's code open to review

2007-08-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Aug 10, 10:36 pm, CC <[EMAIL PROTECTED]> wrote: >> Hi: >> >> http://web.newsguy.com/crcarl/python/hexl.py >> >> This is my first Python program other than tutorial code snippet >> experimentation. I chose a hex line editor. I may do a hex screen >> editor once this i

Re: LRU cache?

2007-08-12 Thread Paul Rubin
Nikita the Spider <[EMAIL PROTECTED]> writes: > This one works for me: > http://www.webfast.com/~skip/python/Cache.py Thanks, this one keeps track of the actual clock time rather than just the relative age of cache entries, and has kind of a weird ageing mechanism, building and sorting an O(n) siz

Re: LRU cache?

2007-08-12 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > So what's wrong with Evan Prodromou's lrucache.py module that's in pypi? > Haven't used it, but can't see anything wrong at a glance. Thanks, I wasn't aware of that one. I notice two things about it: 1) it's under a GPL-incompatible license (therefore a

Re: Binary, Hex, and Decimal string conversions

2007-08-12 Thread Dick Moores
At 04:20 PM 8/12/2007, Robert Dailey wrote: Well, I decided to implement my own way of doing this. I've attached the source. You're all welcome :) On 8/12/07, Michael Bentley < [EMAIL PROTECTED]> wrote: Hi Robert, On Aug 11, 2007, at 3:59 PM, Robert Dailey wrote: Hi, I was wondering if there

Re: Python not freeing memory (?)

2007-08-12 Thread Chris Fonnesbeck
Martin v. Löwis v.loewis.de> writes: > If you want others to help you in finding the bug, you > need to provide more detail, e.g. a specific piece of > code that reproducibly wastes memory. If you want to > study how Python objects are allocated and released, > you need to create a debug build of

The Truth

2007-08-12 Thread laelahaellallah5
Explore & discover & be convinced that ISLAM is the truth! ... Please Visit: http://www.beconvinced.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Hex editor - Python beginner's code open to review

2007-08-12 Thread kyosohma
On Aug 10, 10:36 pm, CC <[EMAIL PROTECTED]> wrote: > Hi: > > http://web.newsguy.com/crcarl/python/hexl.py > > This is my first Python program other than tutorial code snippet > experimentation. I chose a hex line editor. I may do a hex screen > editor once this is done, if I feel like playing wit

Re: Ligmail bug?

2007-08-12 Thread Ed Leafe
On Aug 12, 2007, at 7:06 AM, Steve Holden wrote: > [Please reply via the list when a response is made via the list. > You may > now have detached the follow-ups from your original question, but at > least if you use the list there's a chance someone else will help > you if > I give up or don't

Re: C++ Runtime Library error message - Pythonwin?

2007-08-12 Thread kyosohma
On Aug 11, 5:48 pm, goldtech <[EMAIL PROTECTED]> wrote: > Hi, > > Doing GIS [Geographic Information Systems] scripts. > > I was running a batch clip script that worked OK for 126 iterations > then I got the following message: > > "Microsoft Visual C++ Runtime Library > > program: C:\python21\pytho

Re: Complexity of methods etc

2007-08-12 Thread kyosohma
On Aug 12, 7:04 pm, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > Hi, > > I was wondering if anyone knew of any resources, where I might be able > to find information about the complexity of certain python functions > or little tips on how to reduce complexity. I mean like the "".join(), > kind of

Re: wxPython - drawing without paint event

2007-08-12 Thread kyosohma
On Aug 12, 4:11 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > On Aug 12, 2:20 pm, Bjoern Schliessmann > [EMAIL PROTECTED]> wrote: > >> But any suggestions what's > >> better for a beginner? The (incomplete) tutorial surely not. > > > Another GUI toolkit. > > Well if all you have t

Re: A dumb question about a class

2007-08-12 Thread Dustan
On Aug 12, 7:35 pm, Dustan <[EMAIL PROTECTED]> wrote: > On Aug 12, 5:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > > > def iter_primes(): > > # an iterator of all numbers between 2 and +infinity > > numbers = itertools.count(2) > > > # generate primes forever >

Re: who is simpler? try/except/else or try/except

2007-08-12 Thread greg
Peter Otten wrote: > try: > > except : > > else: > > > When you move the else suite into the try...except > > try: > > # > except : > Note that in general the semantics of these are different, since in the first version the except clause will only catch exceptions in

Re: python + XUL

2007-08-12 Thread Luis M . González
On Aug 12, 3:21 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Madhu Alagu wrote: > > Hi > > > Python + XUL Success Stories > > > Thanks > > > Madhu Alagu > > Any chance you forgot to ask a question? > > Stefan My telepatic powers tell me that this means: "I don't really feel like googling, so j

Re: Pausing and Unpausing Threads

2007-08-12 Thread Aaron J. M.
Uhg, I thought of something I didn't consider before: how to cleanly end the Server/DirectedControl(l)er process. Assuming that the Client only sends Actions to the DirectedController while the DirectedController is in its turn() method (which I would probably regulate using some flag in DirectedC

Re: Complexity of methods etc

2007-08-12 Thread Dustan
On Aug 12, 7:04 pm, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > Hi, > > I was wondering if anyone knew of any resources, where I might be able > to find information about the complexity of certain python functions > or little tips on how to reduce complexity. I mean like the "".join(), > kind of

Re: A dumb question about a class

2007-08-12 Thread Dustan
On Aug 12, 5:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > def iter_primes(): > # an iterator of all numbers between 2 and +infinity > numbers = itertools.count(2) > > # generate primes forever > while True: > > # get the first number from

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-12 Thread Erik Max Francis
Hrvoje Niksic wrote: > For ordinalSum, using imap is almost twice as fast: > > $ python -m timeit -s 'data=[chr(x) for x in xrange(256)]' 'sum(ord(x) for x > in data)' > 1 loops, best of 3: 92.4 usec per loop > $ python -m timeit -s 'data=[chr(x) for x in xrange(256)]; from itertools > impo

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-12 Thread Erik Max Francis
Alexander Schmolck wrote: > Is this any faster? > > ordSum, orsSumSq = (lambda c:c.real,c.imag)(sum(complex(ord(x),ord(x)<<1) > for x in data)) That's pretty clever, but I neglected to mention that I need to accumulate the sums as ints/longs to

Complexity of methods etc

2007-08-12 Thread Nathan Harmston
Hi, I was wondering if anyone knew of any resources, where I might be able to find information about the complexity of certain python functions or little tips on how to reduce complexity. I mean like the "".join(), kind of thing? I want to see if there are any improvements I can add to my coding

Re: A dumb question about a class

2007-08-12 Thread Dick Moores
At 03:35 PM 8/12/2007, Steven Bethard wrote: >Note that if you just want to iterate over all the primes, there's no >need for the class at all. Simply write:: > > for prime in iter_primes(): Even if I want to test only 1 integer, or want the list of primes in a certain interval, I don't nee

Apache cgi and multiple versions of python

2007-08-12 Thread Lars Wessman
I am running OS X and have Python 2.3 installed with the system and have installed 2.5 using the installer available at pythonmac.org. I am running the system install of Apache 1.3 and I am not using mod_python. When Apache 1.3 runs Python cgi scripts, the cgitb output indicates that the verision

Re: Binary, Hex, and Decimal string conversions

2007-08-12 Thread Robert Dailey
Well, I decided to implement my own way of doing this. I've attached the source. You're all welcome :) On 8/12/07, Michael Bentley <[EMAIL PROTECTED]> wrote: > > Hi Robert, > On Aug 11, 2007, at 3:59 PM, Robert Dailey wrote: > > Hi, I was wondering if there is a built in module that supports conve

Re: wxPython - drawing without paint event

2007-08-12 Thread Bjoern Schliessmann
7stud wrote: > On Aug 12, 2:20 pm, Bjoern Schliessmann > But any suggestions what's >> better for a beginner? The (incomplete) tutorial surely not. > Another GUI toolkit. So it seems your dislike is not for the book, but for the toolkit. Regards, Björn -- BOFH excuse #414: tachyon emission

Re: Python not freeing memory (?)

2007-08-12 Thread Robert Kern
Chris wrote: > I have a Bayesian simulation package that keeps running into memory > allocation problems. I have a feeling this has something to do with > Python (2.5.1.1) not freeing memory. The program essentially > iterates n times, each time proposing new arrays (numpy) of values > that are

Re: Python not freeing memory (?)

2007-08-12 Thread Martin v. Löwis
> Is there *any* way of getting around this? Sure: Determine the bug, and fix it. A prerequisite is that you have the source code of all extension modules which you are using, but that seems to be the case. If you want others to help you in finding the bug, you need to provide more detail, e.g. a

Re: A dumb question about a class

2007-08-12 Thread Steven Bethard
Dick Moores wrote: > At 03:09 PM 8/12/2007, Steven Bethard wrote: > >> Here's how I'd write the recipe:: >> >> import itertools >> >> def iter_primes(): >> # an iterator of all numbers between 2 and +infinity >> numbers = itertools.count(2) >> >> # generate pri

Re: A dumb question about a class

2007-08-12 Thread Dick Moores
At 03:09 PM 8/12/2007, Steven Bethard wrote: >Here's how I'd write the recipe:: > > import itertools > > def iter_primes(): > # an iterator of all numbers between 2 and +infinity > numbers = itertools.count(2) > > # generate primes forever > while True

Re: A dumb question about a class

2007-08-12 Thread Steven Bethard
Dick Moores wrote: > I'm still trying to understand classes. I've made some progress, I > think, but I don't understand how to use this one. How do I call it, or > any of its functions? It's from the Cookbook, at > . The short answ

A dumb question about a class

2007-08-12 Thread Dick Moores
I'm still trying to understand classes. I've made some progress, I think, but I don't understand how to use this one. How do I call it, or any of its functions? It's from the Cookbook, at . Thanks, Dick Moores ===

Re: cgi and headers

2007-08-12 Thread Steve Holden
kalin mintchev wrote: > hi there... > > i'm starting to work with python cgi scripts using ajax. > one problem i have is that the cgi module doesn;t do (apparently) anything > without the -- print "Content-type: text/html\n" -- line in the script. > > the issue is that the output of the script ha

Re: wxPython - drawing without paint event

2007-08-12 Thread Steve Holden
7stud wrote: > On Aug 12, 2:20 pm, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: >> But any suggestions what's >> better for a beginner? The (incomplete) tutorial surely not. >> > > Another GUI toolkit. > > Well if all you have to offer is fatuous advice you would be helping people more by kee

Re: cgi and headers

2007-08-12 Thread kalin mintchev
nevermind... i'm not sure why the xml header didn;t work before and now it does... thanks > > hi there... > > i'm starting to work with python cgi scripts using ajax. > one problem i have is that the cgi module doesn;t do (apparently) anything > without the -- print "Content-type: text/html

cgi and headers

2007-08-12 Thread kalin mintchev
hi there... i'm starting to work with python cgi scripts using ajax. one problem i have is that the cgi module doesn;t do (apparently) anything without the -- print "Content-type: text/html\n" -- line in the script. the issue is that the output of the script has to be an xml file and not an html

Re: Regular Expression Grouping

2007-08-12 Thread Paul McGuire
On Aug 12, 12:21 pm, [EMAIL PROTECTED] wrote: > > I cannot understand why 'c' constitutes a group here without being > surrounded by "(" ,")" ? > > >>>import re > >>> m = re.match("([abc])+", "abc") > >>> m.groups() > > ('c',) > It sounds from the other replies that this is just the way re's work

Re: Web based Reporting tool for Python

2007-08-12 Thread Jorge Godoy
Jon Rosebaugh wrote: > Sure, but again, these aren't reporting engines; they're just template > engines. And I don't think any of the web template engines have PDF > output. I generate my PDFs with Genshi / Kid and ReportLab. For the markup processing I use z3c.rml. Works flawlessly. -- http://

Python not freeing memory (?)

2007-08-12 Thread Chris
I have a Bayesian simulation package that keeps running into memory allocation problems. I have a feeling this has something to do with Python (2.5.1.1) not freeing memory. The program essentially iterates n times, each time proposing new arrays (numpy) of values that are evaluated using statis

Re: wxPython - drawing without paint event

2007-08-12 Thread 7stud
On Aug 12, 2:20 pm, Bjoern Schliessmann wrote: > But any suggestions what's > better for a beginner? The (incomplete) tutorial surely not. > Another GUI toolkit. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pausing and Unpausing Threads

2007-08-12 Thread Aaron J. M.
On Aug 12, 3:55 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > By this definition, if there is no "action" supplied, a > "DirectedControler" will result in blocking ALL others (directed or not) > in this "server" (as it blocks the entire server thread). > > Is that really the be

Re: wxPython - drawing without paint event

2007-08-12 Thread Bjoern Schliessmann
7stud wrote: > I don't. "wxPython in Action" is by far the worst computer book > I've ever purchased. It's poorly organized, poorly written, and > full of mistakes--and it's expensive. The fact that the authors > foist that piece of junk on unsuspecting newbies is a crime. Your opinion (I've se

Re: Querying Graphics Card Name

2007-08-12 Thread Jorgen Grahn
On Thu, 09 Aug 2007 21:58:54 -, Benjamin Goldenberg <[EMAIL PROTECTED]> wrote: > On Aug 9, 3:26 pm, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: >> Benjamin Goldenberg wrote: >> > I would like to find out the name of the graphics card of the >> > machine my program is running on. I have look

Re: is there anybody using __del__ correctly??

2007-08-12 Thread Steven Bethard
Michele Simionato wrote: > On Aug 10, 7:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: >> There were also a few recipes posted during this discussion that wrap >> weakrefs up a bit nicer so it's easier to use them in place of __del__: >> >> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/

Re: Fatest standard way to sum bytes (and their squares)?

2007-08-12 Thread Hrvoje Niksic
Erik Max Francis <[EMAIL PROTECTED]> writes: > So far the fastest way I've found is using the `sum` builtin and > generators:: > > ordinalSum = sum(ord(x) for x in data) > ordinalSumSquared = sum(ord(x)**2 for x in data) For ordinalSum, using imap is almost twice as fast: $ python -m

Re: who is simpler? try/except/else or try/except

2007-08-12 Thread Fabio Z Tessitore
Il Sun, 12 Aug 2007 20:06:23 +0200, Peter Otten ha scritto: [cut] > at the same time introducing the implicit > constraint that the latter does not fail with . > Therefore the original code gives the reader a much clearer notion of > the author's intention. This may not be a problem for the simpl

Re: Formatting Results so that They Can be Nicely Imported into a Spreadsheet.

2007-08-12 Thread Gabriel Genellina
En Sun, 05 Aug 2007 06:06:54 -0300, SMERSH009 <[EMAIL PROTECTED]> escribió: > The only question that remains for me--and this is just for my > knowledge-- what does the "if i" mean in this code snippet? > f = [i.split() for i in d if i] > How is it helpful to leave a dangling "if i"? Why not jus

Re: who is simpler? try/except/else or try/except

2007-08-12 Thread Peter Otten
Fabio Z Tessitore wrote: > reading Dive Into Python, on Chapter 6 (exception), I've found: > > "This code comes from the getpass module, a wrapper module for getting a > password from the user" > try: > from EasyDialogs import AskPassword >   

Re: Regular Expression Grouping

2007-08-12 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Fairly new to this regex thing, so this might be very juvenile but > important. > > I cannot understand and why 'c' constitutes a group here without being > surrounded by "(" ,")" ? > > >>>import re > >>> m = re.match("([abc])+", "abc")

Re: Public Telnet Server?

2007-08-12 Thread Jorgen Grahn
On Sat, 11 Aug 2007 15:07:25 -, Dave <[EMAIL PROTECTED]> wrote: > Hi there. I'm a beginner at Python and I'm writing my first Python > script. It's a text adventure about coffee and mixing drinks and being > crazy and such. I keep updating it and want my friends to beta test it > for me, but so

Re: who is simpler? try/except/else or try/except

2007-08-12 Thread Fabio Z Tessitore
Il Sun, 12 Aug 2007 13:49:18 -0400, Steve Holden ha scritto: >> > In matters of style such as this there *are* only opinions. I don't > think there are definite grounds for preferring either one. Opinions are what I'd like to see, because most of you have bigger experience than me. maybe this e

Re: Regular Expression Grouping

2007-08-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Fairly new to this regex thing, so this might be very juvenile but > important. > > I cannot understand and why 'c' constitutes a group here without being > surrounded by "(" ,")" ? > import re m = re.match("([abc])+", "abc") m.groups() > ('c',) > > Grat

Re: Regular Expression Grouping

2007-08-12 Thread linnewbie
On Aug 12, 1:31 pm, Fabio Z Tessitore <[EMAIL PROTECTED]> wrote: > Il Sun, 12 Aug 2007 17:21:02 +, linnewbie ha scritto: > > > Fairly new to this regex thing, so this might be very juvenile but > > important. > > > I cannot understand and why 'c' constitutes a group here without being > > surro

Re: who is simpler? try/except/else or try/except

2007-08-12 Thread Steve Holden
Fabio Z Tessitore wrote: > Hi all, > > reading Dive Into Python, on Chapter 6 (exception), I've found: > > "This code comes from the getpass module, a wrapper module for getting a > password from the user" > > try: > import termios, TERMIOS > except ImportError: > try: >

Re: Launch file from Python

2007-08-12 Thread Jorgen Grahn
On Wed, 08 Aug 2007 10:28:57 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Good afternoon from someone who is trying to learn Python. > > I would like to launch an app from within a Python script. From the > examples I have found, I should be able to do this with os.system. > > I use this:

Re: Regular Expression Grouping

2007-08-12 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Fairly new to this regex thing, so this might be very juvenile but > important. > > I cannot understand and why 'c' constitutes a group here without being > surrounded by "(" ,")" ? > import re m = re.match("([abc])+", "abc") m.groups() > ('c',) > > Grat

Re: Regular Expression Grouping

2007-08-12 Thread Fabio Z Tessitore
Il Sun, 12 Aug 2007 17:21:02 +, linnewbie ha scritto: > Fairly new to this regex thing, so this might be very juvenile but > important. > > I cannot understand and why 'c' constitutes a group here without being > surrounded by "(" ,")" ? > import re m = re.match("([abc])+", "abc") >

Regular Expression Grouping

2007-08-12 Thread linnewbie
Fairly new to this regex thing, so this might be very juvenile but important. I cannot understand and why 'c' constitutes a group here without being surrounded by "(" ,")" ? >>>import re >>> m = re.match("([abc])+", "abc") >>> m.groups() ('c',) Grateful for any clarity. -- http://mail.python.o

Re: Puzzled by "is"

2007-08-12 Thread Dick Moores
At 09:59 AM 8/12/2007, Steve Holden wrote: >Dick Moores wrote: > > At 08:23 AM 8/12/2007, Steve Holden wrote: > >> Dick Moores wrote: > >>> So would a programmer EVER use "is" in a script? > >> Sure. For example, the canonical test for None uses > >> > >> x is None > >> > >> because there is o

Re: Pausing and Unpausing Threads

2007-08-12 Thread Martin v. Löwis
> I'm worried that this loop may wast some CPU cycles, and wonder if > there's a better way through thread synchronization using such things > as Events or Conditions. Typically, people are after the Queue module in such cases. Each DirectedControl(l)er would have an instance of the Queue class, a

who is simpler? try/except/else or try/except

2007-08-12 Thread Fabio Z Tessitore
Hi all, reading Dive Into Python, on Chapter 6 (exception), I've found: "This code comes from the getpass module, a wrapper module for getting a password from the user" try: import termios, TERMIOS except ImportError: try: import msvcrt except ImportError

Re: Web based Reporting tool for Python

2007-08-12 Thread Jon Rosebaugh
On 2007-08-12 06:08:49 -0500, Steve Holden <[EMAIL PROTECTED]> said: > Steve Holden wrote: >> Madhu Alagu wrote: >>> On Aug 8, 4:57 pm, Jon Rosebaugh <[EMAIL PROTECTED]> wrote: On 2007-08-07 23:35:26 -0500, Madhu Alagu <[EMAIL PROTECTED]> said: > Thanking so much for all the informa

Re: Puzzled by "is"

2007-08-12 Thread Steve Holden
Dick Moores wrote: > At 08:23 AM 8/12/2007, Steve Holden wrote: >> Dick Moores wrote: >>> So would a programmer EVER use "is" in a script? >> Sure. For example, the canonical test for None uses >> >> x is None >> >> because there is only ever one instance of type Nonetype, so it's the >> faste

Re: Puzzled by "is"

2007-08-12 Thread Dick Moores
At 08:23 AM 8/12/2007, Steve Holden wrote: >Dick Moores wrote: > > So would a programmer EVER use "is" in a script? > >Sure. For example, the canonical test for None uses > > x is None > >because there is only ever one instance of type Nonetype, so it's the >fastest test. Generally speaking yo

Re: LRU cache?

2007-08-12 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > Anyone got a favorite LRU cache implementation? I see a few in google > but none look all that good. I just want a dictionary indexed by > strings, that remembers the last few thousand entries I put in it. > > It ac

Re: ANN: Compyler 0.1

2007-08-12 Thread Irmen de Jong
Grant Olson wrote: > Compyler is a pre-alpha x86 native code compiler. In what ways is this similar or different to Shed Skin? http://mark.dufour.googlepages.com/ --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzled by "is"

2007-08-12 Thread Steve Holden
Dick Moores wrote: > On 8/12/07, *Ben Finney* <[EMAIL PROTECTED] > > wrote: > > Dick Moores <[EMAIL PROTECTED] > writes: > > > At 06:13 PM 8/9/2007, Ben Finney wrote: > > >it's entirely left to the language implementation which >

Re: Database intensive application

2007-08-12 Thread johnf
Rohit wrote: > I am a novice. I want to know whether Python can be used to develop > client/server database and web applications like .NET. Which is the > best book/source to learn Python? IMO you should use Dabo (www.dabodev.com). If you want to strike on your own check using SQLAlchemy as you

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-12 Thread Robert Dailey
That's a bit hard given the unpredictability of each person on that list. What seems like a simple question one minute suddenly turns into a flamewar because someone had a bad day at work and needed to vent at my expense. This is beyond phrasing your questions properly. It has to do with just pure

Re: wxPython - drawing without paint event

2007-08-12 Thread 7stud
On Aug 12, 6:06 am, Bjoern Schliessmann wrote: > I really recommend reading "wxPython in Action", or at least the > tutorial. > I don't. "wxPython in Action" is by far the worst computer book I've ever purchased. It's poorly organized, poorly written, and full of mistakes--and it's expensive.

Bill Gates try to sell Microsoft @ ebay look here

2007-08-12 Thread MartinWuitz
http://www.pennergame.de/ref.php?uid=4762 http://www.pennergame.de/ref.php?uid=5572 -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzled by "is"

2007-08-12 Thread Dick Moores
On 8/12/07, Ben Finney <[EMAIL PROTECTED]> wrote: > > Dick Moores <[EMAIL PROTECTED]> writes: > > > At 06:13 PM 8/9/2007, Ben Finney wrote: > > >it's entirely left to the language implementation which > > >optimisation trade-offs to make, and the language user (that's you > > >and I) should *not* e

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-12 Thread John J. Lee
"Chris Mellon" <[EMAIL PROTECTED]> writes: [...] > The minimum bounds for a line is at least one byte (the newline) and > maybe more, depending on your data. You can seek() forward the minimum > amount of bytes that (1 billion -1) lines will consume and save > yourself some wasted IO. But how do y

Re: Database intensive application

2007-08-12 Thread Peter Decker
On 8/12/07, Rohit <[EMAIL PROTECTED]> wrote: > I am a novice. I want to know whether Python can be used to develop > client/server database and web applications like .NET. Which is the > best book/source to learn Python? You've already gotten several excellent answers for web applications; if you

  1   2   >