Re: Printing digits in one place

2008-11-24 Thread Lawrence D'Oliveiro
Oltmans wrote: > Bytes Transfered so far X > > and X will increase and cursor should stay at this position. Most terminal emulators are VT100-compatible these days. You could use something like [80D to move back to the beginning of the same line. -- http://mail.python.org/mailman/listinfo/pytho

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Lawrence D'Oliveiro
"Martin v. Löwis" wrote: > That doesn't really explain it. It always was os.path.extsep, > but it *also* was os.extsep. > > I don't know the rationale for this change myself, either. Probably because it's considered platform-specific. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a directory file descriptor?

2008-11-24 Thread r0g
Cong Ma wrote: > Dear all, > > Can you give me some hint on getting a directory file descriptor in Python? > Besides, what's good about os.fchdir() if I can't get a directory fd in the > first place? > > Thanks for your reply. > > Regards, > Cong. > for each in os.listdir(os.getcwd()): print

Re: Security implications of using open() on untrusted strings.

2008-11-24 Thread Lawrence D'Oliveiro
Jorgen Grahn wrote: > Seems to me you simply want to know beforehand that the reading will > work. But you can never check that! You can stat(2) the file, or > open-and-close it -- and then a microsecond later, someone deletes the > file, or replaces it with another one, or write-protects it, or

Re: Python surpasses Perl in popularity?

2008-11-24 Thread Lawrence D'Oliveiro
[EMAIL PROTECTED] wrote: > I would venture so far to say that perl is todays 'C'.. Perl is the FORTRAN of scripting languages. Python is in some ways like Pascal. Java is like COBOL. C? Who knows... -- http://mail.python.org/mailman/listinfo/python-list

Re: Security implications of using open() on untrusted strings.

2008-11-24 Thread r0g
Jorgen Grahn wrote: > On Mon, 24 Nov 2008 00:44:45 -0500, r0g <[EMAIL PROTECTED]> wrote: >> Hi there, >> >> I'm trying to validate some user input which is for the most part simple >> regexery however I would like to check filenames and I would like this >> code to be multiplatform. >> >> I had hop

Instance attributes vs method arguments

2008-11-24 Thread John O'Hagan
Is it better to do this: class Class_a(): def __init__(self, args): self.a = args.a self.b = args.b self.c = args.c self.d = args.d def method_ab(self): return self.a + self.b def met

How to get a directory file descriptor?

2008-11-24 Thread Cong Ma
Dear all, Can you give me some hint on getting a directory file descriptor in Python? Besides, what's good about os.fchdir() if I can't get a directory fd in the first place? Thanks for your reply. Regards, Cong. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in popularity?

2008-11-24 Thread John Machin
On Nov 25, 4:57 pm, [EMAIL PROTECTED] wrote: > Quoting John Machin <[EMAIL PROTECTED]>: > > > I'll try again: On what grounds do you assert that "Many libraries, > > aren't as sophisticated - ie spreadsheet reading and writing."? What > > Python spreadsheet reading and writing libraries have you us

Re: initialized list: strange behavior

2008-11-24 Thread Jason Scheirer
On Nov 24, 10:34 pm, [EMAIL PROTECTED] wrote: > Hi Python experts! Please explain this behavior: > > >>> nn=3*[[]] > >>> nn > [[], [], []] > >>> mm=[[],[],[]] > >>> mm > > [[], [], []] > > Up till now, 'mm' and 'nn' look the same, right? Nope! > > >>> mm[1].append(17) > >>> mm > [[], [17], []] > >>

Re: initialized list: strange behavior

2008-11-24 Thread Gary Herron
[EMAIL PROTECTED] wrote: > Hi Python experts! Please explain this behavior: > [] make an empty list. [ [],[],[] ] makes a list of three different empty lists. 3*[[]] makes a list of three references to the same list. Realy, that should explain it all, but perhaps there are enough empty lists

ROGER DUBUIS WATCHES

2008-11-24 Thread [EMAIL PROTECTED]
http://www.flyingzg.com/roger-dubuis-watches-c-113.html Founded by Carlos Dias in 1995 as SOGEM SA (Socie`te` Genevoise des Montres), the company did not lay claim to its current title of Manufacture until 1999. In March 2001, he established the first building of the Manufacture ROGER DUBUIS in th

initialized list: strange behavior

2008-11-24 Thread alexander . genkin
Hi Python experts! Please explain this behavior: >>> nn=3*[[]] >>> nn [[], [], []] >>> mm=[[],[],[]] >>> mm [[], [], []] Up till now, 'mm' and 'nn' look the same, right? Nope! >>> mm[1].append(17) >>> mm [[], [17], []] >>> nn[1].append(17) >>> nn [[17], [17], [17]] ??? Python 2.5 Win XP Thank

Re: Palette-mode PNG images

2008-11-24 Thread Lawrence D'Oliveiro
Lawrence D'Oliveiro wrote: > Ideally I'd like to create a PNG file with just two bits per pixel, with > four colour-table entries of my choice. I'm using PyCairo > to do the drawing, but that > doesn't seem to support colour-table images as far as I can tell

Re: Python surpasses Perl in popularity?

2008-11-24 Thread david . lyon
Quoting John Machin <[EMAIL PROTECTED]>: I'll try again: On what grounds do you assert that "Many libraries, aren't as sophisticated - ie spreadsheet reading and writing."? What Python spreadsheet reading and writing libraries have you used? In what way are they less sophisticated than their per

Re: Multiple equates

2008-11-24 Thread Lawrence D'Oliveiro
Cameron Laird wrote: > I've been trying to decide if there's any sober reason to advocate > the one-liner > > map(lambda i: a.__setitem__(i, False), [x1, x2, x3, ..., x1024]) Are lambdas like the Dark Side of Python? :) -- http://mail.python.org/mailman/listinfo/python-list

Accessing Modification Time of an Outlook Mail in Python

2008-11-24 Thread [EMAIL PROTECTED]
Hi all, I am writing a small application which reads the contents of an Outlook Mail using python. I am able to read the contents, subject along with senders and receivers of a mail using MAPI objects. But may I know how can I get access to the "modification time" or the receiving time of an

Re: Python surpasses Perl in popularity?

2008-11-24 Thread Richard Riley
alex23 <[EMAIL PROTECTED]> writes: > On Nov 25, 11:25 am, [EMAIL PROTECTED] wrote: >> Perl is todays language of technical complexity. It is obscure,   >> complex, and is oriented towards the supremely intelligent [...] > > I think you misspelled "insular". Sounds like eLisp :-; -- http://mail.py

Re: Python surpasses Perl in popularity?

2008-11-24 Thread alex23
On Nov 25, 11:25 am, [EMAIL PROTECTED] wrote: > Perl is todays language of technical complexity. It is obscure,   > complex, and is oriented towards the supremely intelligent [...] I think you misspelled "insular". -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in popularity?

2008-11-24 Thread John Machin
On Nov 25, 2:59 pm, [EMAIL PROTECTED] wrote: > Quoting John Machin <[EMAIL PROTECTED]>: > > > Care to elaborate on the relative unsophistication of Python > > spreadsheet reading and writing libraries? > > > Cheers, > > John > > Not really. > > But one only has to use both languages on a regular ba

Re: Python surpasses Perl in popularity?

2008-11-24 Thread david . lyon
Quoting John Machin <[EMAIL PROTECTED]>: Care to elaborate on the relative unsophistication of Python spreadsheet reading and writing libraries? Cheers, John Not really. But one only has to use both languages on a regular basis to realise that perl is well ahead on the libaray/module front

online dating louisville

2008-11-24 Thread porphyrymoralesnh
online dating louisville . . . ***CLICK HERE http://dating365.co.cc/online-dating-louisville * . . . . . . . . . . . . online dating louisville -- http://mail.python.org/mailman/listinfo/python-list

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Martin> In any case - if the intention was that extsep is now not > Martin> supported anymore, it should have been removed from the other > Martin> *path modules as well (along with removing it from the > Martin> documentation). > > No, that wasn't my int

Re: Python surpasses Perl in popularity?

2008-11-24 Thread John Machin
On Nov 25, 12:25 pm, [EMAIL PROTECTED] wrote: > Python, whilst very powerful, doesn't have the sheer scale of   > contributors that Perl has. ie cpan. Many libraries, aren't as   > sophisticated - ie spreadsheet reading and writing. Care to elaborate on the relative unsophistication of Python spr

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
> Martin> Not that I regret it's gone - it was a useless constant, anyway, > Martin> as the extension separator is '.' on all interesting systems. > > Except if you diff r57096 and r57097 I suspect you'll find that it was > different in RISCOS. I did, and interestingly enough, you won't

Re: Quick question about None and comparisons

2008-11-24 Thread Chris Rebert
On Mon, Nov 24, 2008 at 5:52 PM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > Sorry for the title but I didn't find anything more appropriate. > To have a less verbose code would it be ok doing: > > if a > b: > > ...instead of: > > if a is not None and a > b: > > ...? > Is there any hidden compli

Re: Quick question about None and comparisons

2008-11-24 Thread r
On Nov 24, 7:52 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Sorry for the title but I didn't find anything more appropriate. > To have a less verbose code would it be ok doing: > > if a > b: > > ...instead of: > > if a is not None and a > b: > > ...? > Is there any hidden complication behi

Re: Start learning 2.6 or wait for 3.0?

2008-11-24 Thread Giampaolo Rodola'
Definitively 2.X. Whether 2.5 or 2.6 doesn't really matter. --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Quick question about None and comparisons

2008-11-24 Thread Giampaolo Rodola'
Sorry for the title but I didn't find anything more appropriate. To have a less verbose code would it be ok doing: if a > b: ...instead of: if a is not None and a > b: ...? Is there any hidden complication behind that? Thanks in advance --- Giampaolo code.google.com/p/pyftpdlib/ -- http://ma

Python surpasses Perl in popularity?

2008-11-24 Thread david . lyon
Interesting topic ! I would venture so far to say that perl is todays 'C'.. Perl is todays language of technical complexity. It is obscure, complex, and is oriented towards the supremely intelligent (or equally - those seeking to get 'lost' in programming). Python, whilst very powerful, d

Usage opinion wanted

2008-11-24 Thread Saurabh Agrawal
Hi group: I hope that you good people here could help me with a decision I am finding hard to make. I am about to develop a MIS type application for a Non for profit organization teaching young children in India. I am trying to use this opportunity to make myself learn python, and if required th

Re: Printing digits in one place

2008-11-24 Thread Tim Chase
Try repeatedly writing something like "\r \rBytes Transferred So Far %d" \ % count Rather than backing up twice with \r, I'd just suggest "\rBytes Transferred So Far %d " % count or even "\rBytes Transferred So Far %d%s" % (count, ' '*20)

Herald: Python surpasses Perl in popularity!

2008-11-24 Thread Xah Lee
herald: Python surpasses Perl in popularity! According to “TIOBE Programming Community Index for November 2008” at http://www.tiobe.com/content/paperinfo/tpci/index.html it seems that Python has surpassed Perl in popularity this month! Good for Python! From my own personal experience in the pro

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread skip
Martin> Martin> r57097 | skip.montanaro | 2007-08-16 16:35:24 +0200 (Do, 16. Aug 2007) | Martin> 1 line Martin> Remove RISCOS support Martin> ---

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
> Except that, as I posted earlier, extsep is the *only* os system info > constant that has been removed from os. Ah, this gives another clue: r57097 | skip.montanaro | 2007-08-16 16:35:24 +0200 (Do, 16. Aug 2007) | 1 line

Re: My first Python program -- a lexer

2008-11-24 Thread Arnaud Delobelle
Thomas Mlynarczyk <[EMAIL PROTECTED]> writes: > John Machin schrieb: > >> *IF* you need to access the regex associated with a token in O(1) >> time, a dict is indicated. > > O(1) - Does that mean `mydict[mykey]` takes the same amount of time, > no matter if mydict has 10 or 10 entries? How

Re: Start learning 2.6 or wait for 3.0?

2008-11-24 Thread Aahz
In article <[EMAIL PROTECTED]>, Alan Biddle <[EMAIL PROTECTED]> wrote: > >I am planning on learning Python, primarily for my own interest, >rather than any immediate need. I am wondering whether I would be >wasting my time to start with the latest 2.6 version which has a lot >of good instructiona

Re: Start learning 2.6 or wait for 3.0?

2008-11-24 Thread Terry Reedy
Alan Biddle wrote: I am planning on learning Python, primarily for my own interest, rather than any immediate need. I am wondering whether I would be wasting my time to start with the latest 2.6 version which has a lot of good instructional material, or wait a bit for version 3.0? If you want

Re: Start learning 2.6 or wait for 3.0?

2008-11-24 Thread Terry Reedy
Alan Biddle wrote: I am planning on learning Python, primarily for my own interest, rather than any immediate need. I am wondering whether I would be wasting my time to start with the latest 2.6 version which has a lot of good instructional material, or wait a bit for version 3.0? -- http://ma

segfault calling SSE enabled library from ctypes

2008-11-24 Thread Olivier Grisel
Hello, It seems that I am able to reproduce the same problem as reported earlier on this list by someone else: http://mail.python.org/pipermail/python-list/2008-October/511794.html Similar setup: python 2.5.2 / gcc (Ubuntu 4.3.2-1ubuntu11) from Intrepid on 32bit intel Core 2 Duo. I can confir

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Terry Reedy
Martin v. Löwis wrote: Perhaps this gives the rationale for the change - migration into the platform modules is now complete. Except that, as I posted earlier, extsep is the *only* os system info constant that has been removed from os. -- http://mail.python.org/mailman/listinfo/python-list

Fwd: [wxpython-users] Setting up global keybindings without corresponding menu items

2008-11-24 Thread mercado mercado
Forwarded conversation Subject: Setting up global keybindings without corresponding menu items From: *mercado mercado* <[EMAIL PROTECTED]> Date: Fri, Aug 1, 2008 at 4:15 PM To: [EMAIL PROTECTED] I'm trying to set up a global keyboard shortcut for my application. I know

Re: Printing digits in one place

2008-11-24 Thread John Machin
On Nov 25, 10:21 am, Oltmans <[EMAIL PROTECTED]> wrote: > I'm writing a file-transfer program and I'm receiving bytes > transferred in a function. Now I would like to print bytes transfered > in one place e.g. > > Bytes Transfered so far X > > and X will increase and cursor should stay at this posi

Re: Printing digits in one place

2008-11-24 Thread Steve Holden
Oltmans wrote: > I'm writing a file-transfer program and I'm receiving bytes > transferred in a function. Now I would like to print bytes transfered > in one place e.g. > > Bytes Transfered so far X > > and X will increase and cursor should stay at this position. I don't > want to use any 3rd par

Start learning 2.6 or wait for 3.0?

2008-11-24 Thread Alan Biddle
I am planning on learning Python, primarily for my own interest, rather than any immediate need. I am wondering whether I would be wasting my time to start with the latest 2.6 version which has a lot of good instructional material, or wait a bit for version 3.0? -- Alan -- http://mail.python.org

Printing digits in one place

2008-11-24 Thread Oltmans
I'm writing a file-transfer program and I'm receiving bytes transferred in a function. Now I would like to print bytes transfered in one place e.g. Bytes Transfered so far X and X will increase and cursor should stay at this position. I don't want to use any 3rd party module for this. Can I someh

Re: Using dictionary to hold regex patterns?

2008-11-24 Thread Steve Holden
John Machin wrote: > On Nov 25, 4:38 am, Thomas Mlynarczyk <[EMAIL PROTECTED]> [...] >>> Judging which of two structures is "simpler" should not be independent >>> of those requirements. I don't see a role for intuition in this >>> process. >> Maybe I should have said "upon first sight" / "judging

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
>> That doesn't really explain it. It always was os.path.extsep, >> but it *also* was os.extsep. > > I've always known it as the former Same here, but see below. > a perusal of the Python repository > would probably indicate when it became exposed in the os module > itself. That's indeed easier

Re: Building Python 2.5.2 for Itanium

2008-11-24 Thread Martin v. Löwis
> Lo and behold! -- > > Performing Custom Build Step > '.\make_versioninfo.exe' is not recognized as an internal or external > command, > operable program or batch file. > Project : error PRJ0019: A tool returned an error code from > "Performing Custom Build Step" Hmm. make_versioninfo.exe should

Re: Python 3.0 - is this true?

2008-11-24 Thread Martin v. Löwis
> Sorry for the delay in replying. Thanks, and I'm in turn sorry myself, too. Here is my experiment: I only looked at the first test case, where a bigfile.txt has occasionally None lines. To run this test, I created a file with 33079296 and 704512 lines, by repeatedly cat'ing /etc/passwd. I the

Re: Python 3.0 - is this true?

2008-11-24 Thread Duncan Grisby
In article <[EMAIL PROTECTED]>, Aahz <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >Duncan Grisby <[EMAIL PROTECTED]> wrote: [...] >>That's exactly my point. Currently, the application just builds a list >>of values retrieved from the database and asks Python to sort it. No >>key o

Re: Using dictionary to hold regex patterns?

2008-11-24 Thread John Machin
On Nov 25, 4:38 am, Thomas Mlynarczyk <[EMAIL PROTECTED]> wrote: > John Machin schrieb: > > > Rephrasing for clarity: Don't use a data structure that is more > > complicated than that indicated by your requirements. > > Could you please define "complicated" in this context? In terms of > characters

Re: max(), sum(), next()

2008-11-24 Thread Scott David Daniels
David C. Ullrich wrote: In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: On Fri, 05 Sep 2008 10:22:22 -0500, David C. Ullrich wrote about why max and min shouldn't accept a default argument: Think about all the previously elected female or black presidents of the U

Re: recommended __future__ imports for 2.5?

2008-11-24 Thread Terry Reedy
Joe Strout wrote: OK, this will probably be placed into the "stupid question" category by some, but I really am in need of a bit of guidance here. I just rediscovered the "gotcha" of integer division in 2.5 and below, and found (to my delight) that this is fixed in 3.0, and fixable in older v

Re: for loop specifying the amount of vars

2008-11-24 Thread Steve Holden
Jules Stevenson wrote: > Hi, > > I have a list which contains a folder structure, for instance: > > dirs=['c:\', 'temp', 'foo', 'bar'] > Of course this should really be dirs=['c:\\', 'temp', 'foo', 'bar'] but we'll overlook your little syntax error ;-) > The length of the list can vary. I'd

recommended __future__ imports for 2.5?

2008-11-24 Thread Joe Strout
OK, this will probably be placed into the "stupid question" category by some, but I really am in need of a bit of guidance here. I just rediscovered the "gotcha" of integer division in 2.5 and below, and found (to my delight) that this is fixed in 3.0, and fixable in older versions of Pytho

Re: Security implications of using open() on untrusted strings.

2008-11-24 Thread Jorgen Grahn
On Mon, 24 Nov 2008 00:44:45 -0500, r0g <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm trying to validate some user input which is for the most part simple > regexery however I would like to check filenames and I would like this > code to be multiplatform. > > I had hoped the os module would have a

Re: No complex rationals in Python 3.0

2008-11-24 Thread Rock
On 24 Nov, 20:31, Christian Heimes <[EMAIL PROTECTED]> wrote: > Rock wrote: > > I appreciate the inclusion of the fractions module in Python 2.6 and > > therefore in Python 3.0. But I feel there's something missing: no > > possibility for complex rationals (or arbitrary precision) integers. I > > w

RE: for loop specifying the amount of vars

2008-11-24 Thread Jules Stevenson
Sorry for the noise, I found the * unpack operator. Perfect for what I need. > > Hi, > > I have a list which contains a folder structure, for instance: > > dirs=['c:\', 'temp', 'foo', 'bar'] > > The length of the list can vary. I'd like to be able to construct a > os.path.join on the list, but

Re: for loop specifying the amount of vars

2008-11-24 Thread Tim Chase
I have a list which contains a folder structure, for instance: dirs=['c:\', 'temp', 'foo', 'bar'] The length of the list can vary. I'd like to be able to construct a os.path.join on the list, but as the list can vary in length I'm unsure how to do this neatly. Sounds like you want argument un

Re: for loop specifying the amount of vars

2008-11-24 Thread Benjamin Kaplan
On Mon, Nov 24, 2008 at 2:31 PM, Jules Stevenson <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list which contains a folder structure, for instance: > > dirs=['c:\', 'temp', 'foo', 'bar'] > > The length of the list can vary. I'd like to be able to construct a > os.path.join on the list, but as the

for loop specifying the amount of vars

2008-11-24 Thread Jules Stevenson
Hi, I have a list which contains a folder structure, for instance: dirs=['c:\', 'temp', 'foo', 'bar'] The length of the list can vary. I'd like to be able to construct a os.path.join on the list, but as the list can vary in length I'm unsure how to do this neatly. I figured I could use a for loo

Re: No complex rationals in Python 3.0

2008-11-24 Thread Christian Heimes
Rock wrote: I appreciate the inclusion of the fractions module in Python 2.6 and therefore in Python 3.0. But I feel there's something missing: no possibility for complex rationals (or arbitrary precision) integers. I was just checking the complex number support in Python, compared, for instance,

Re: No complex rationals in Python 3.0

2008-11-24 Thread bearophileHUGS
Rock: >so I guess this could be an important issue.< What they can be useful for? Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000

2008-11-24 Thread Diez B. Roggisch
alex23 wrote: > On Nov 24, 5:47 pm, Dokorek <[EMAIL PROTECTED]> wrote: >> Python 3000 (a.k.a. "Py3k", and released as Python 3.0) is a new >> version of the language that is incompatible with the 2.x line of >> releases. The language is mostly the same, but many details, >> especially how built-in

Re: Building Python 2.5.2 for Itanium

2008-11-24 Thread Christopher
On Nov 21, 3:50 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >   I need to compile that module for that release and platform, but I > > have been unable to discover which MS compiler version and runtime was > > used to generate the binaries.  My understanding is that Python 2.5.2 > > in gener

Re: Install modules with no root privilegies

2008-11-24 Thread Diez B. Roggisch
Philipp Pagel wrote: > Alfons Nonell-Canals <[EMAIL PROTECTED]> wrote: >> Install python modules in a linux computer is really easy, it is because >> the module is a package of the distribution or because the python >> installation is really easy. But, in both situations, you need root >> privileg

No complex rationals in Python 3.0

2008-11-24 Thread Rock
I appreciate the inclusion of the fractions module in Python 2.6 and therefore in Python 3.0. But I feel there's something missing: no possibility for complex rationals (or arbitrary precision) integers. I was just checking the complex number support in Python, compared, for instance, to Common Lis

Re: Install modules with no root privilegies

2008-11-24 Thread Scott David Daniels
Alfons Nonell-Canals wrote: Hello, Install python modules in a linux computer is really easy, it is because the module is a package of the distribution or because the python installation is really easy. But, in both situations, you need root privilegies. I would like to know how to install modul

Re: My first Python program -- a lexer

2008-11-24 Thread Steve Holden
Thomas Mlynarczyk wrote: > John Machin schrieb: > >> *IF* you need to access the regex associated with a token in O(1) >> time, a dict is indicated. > > O(1) - Does that mean `mydict[mykey]` takes the same amount of time, no > matter if mydict has 10 or 10 entries? How does this magic wor

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-24 Thread Scott David Daniels
Jerzy Jalocha N wrote: I'm new in this list (and to Python), so I'd like to start saying hello to everyone first. I am really enjoying this new language! I am trying to use the standard tests (like test_list.py or test_dict.py) from the standard library (Python2.5), but they aren't available on

Re: how to dynamically instantiate an object inheriting from several classes?

2008-11-24 Thread Joe Strout
On Nov 24, 2008, at 11:10 AM, Matimus wrote: I wrote this a while ago. I sort of regret it though. Mixins could (and I will argue should) be avoided most of the time by delegating to other objects with less functionality. Utilizing many mixin classes tends to just make gigantic classes. This is

Re: how to dynamically instantiate an object inheriting from several classes?

2008-11-24 Thread Matimus
On Nov 21, 2:11 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > I have a function that takes a reference to a class, and then   > instantiates that class (and then does several other things with the   > new instance).  This is easy enough: > >     item = cls(self, **itemArgs) > > where "cls" is the cla

Re: Using dictionary to hold regex patterns?

2008-11-24 Thread Thomas Mlynarczyk
John Machin schrieb: Rephrasing for clarity: Don't use a data structure that is more complicated than that indicated by your requirements. Could you please define "complicated" in this context? In terms of characters to type and reading, the dict is surely simpler. But I suppose that under t

Re: RELEASED Python 3.0rc3

2008-11-24 Thread Trent Mick
And 2.6 is in final release? So when ActiveState speaks of 2.6.0.0 they mean a final release? Yes. The first three parts of the ActivePython version are the same as the core Python version on which it is based. So, if the IDLE from ActiveState comes up and says 2.6 (indicating final release

Re: My first Python program -- a lexer

2008-11-24 Thread Thomas Mlynarczyk
John Machin schrieb: *IF* you need to access the regex associated with a token in O(1) time, a dict is indicated. O(1) - Does that mean `mydict[mykey]` takes the same amount of time, no matter if mydict has 10 or 10 entries? How does this magic work? O(log n) I would understand, but

Re: Python 3.0 - is this true?

2008-11-24 Thread Tim Rowe
2008/11/24 Aahz <[EMAIL PROTECTED]>: > (I'll agree that from some perspectives the new behavior of None is a > wart but I think that in the end I agree with people who say that > preventing None from being sorted except intentionally will trap more > bugs earlier.) So will Python be introducing s

Re: crack registration codes for pogo games

2008-11-24 Thread Kristie
your site doesn't come up. I was looking for crack registration codes for any pogo games. Kristie-- http://mail.python.org/mailman/listinfo/python-list

Re: Using dictionary to hold regex patterns?

2008-11-24 Thread Thomas Mlynarczyk
Dennis Lee Bieber schrieb: Is "[ ( name, regex ), ... ]" really "simpler" than "{ name: regex, ... }"? Intuitively, I would consider the dictionary to be the simpler structure. Why, when you aren't /using/ the name to retrieve the expression... So as soon as I start retrieving a re

Re: Security implications of using open() on untrusted strings.

2008-11-24 Thread Terry Reedy
r0g wrote: Yep, I spotted that too which is why white-listing is my fallback plan. My question is really about the security of using unfiltered data in a filesystem function though. Are there particualar exploits that could make use of such unfiltered calls? The classic one would be submitting

ANN: Resolver One 1.3 released

2008-11-24 Thread Giles Thomas
We are proud to announce the release of Resolver One, version 1.3. Resolver One is a spreadsheet that allows you to write Python directly in cells, and converts the spreadsheets you create into Python programs. It's based on IronPython, and runs on Windows. For version 1.3, we've made two big cha

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Terry Reedy
Christian Heimes wrote: bMotu wrote: IDLE 2.6 import os os.extsep '.' running XP this result is fine ... ! IDLE 3.0rc3 import os os.extsep Traceback (most recent call last): File "", line 1, in os.extsep AttributeError: 'module' object has no attribute 'extsep' why is this attribute

Re: Python 3.0 - is this true?

2008-11-24 Thread Aahz
In article <[EMAIL PROTECTED]>, Duncan Grisby <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >Terry Reedy <[EMAIL PROTECTED]> wrote: >> >>Replace the sublists with a coded string, such as '\0'+line. > >Again, this is just an example. As I say, in the real application, the >data has c

Re: PIL (python imaging library) or Mathematics help both appreciated

2008-11-24 Thread Jorgen Grahn
On Mon, 24 Nov 2008 00:52:02 -0800 (PST), amine <[EMAIL PROTECTED]> wrote: > well, here is the background. I have images of objects (cars, > clothes, ...) with a white background in most of the cases > > I have to build a function with PIL that takes away the background. > it seems simple, just lo

Python-URL! - weekly Python news and links (Nov 24)

2008-11-24 Thread Gabriel Genellina
QOTW: "One of the reasons for Python's continue march towards world domina- tion (allow me my fantasies) is its consistent simplicity. Those last two words would be my candidate for the definition of 'Pythonicity'." - Steve Holden http://groups.google.com/group/comp.lang.python/msg/e2518ea8388

[ANN]: pdftools.pdfposter 0.4.5

2008-11-24 Thread Hartmut Goebel
I'm pleased to announce pdftools.pdfposter 0.4.5, a tool to scale and tile PDF images/pages to print on multiple pages. http://pdfposter.origo.ethz.ch/download/ This version honors cropped pages (/ArtBoxes, /CropBox). Starting with version 0.4.5, the package was renamed to 'pdftools.pdfposter

Re: Estimating size of dictionary

2008-11-24 Thread python
Steven, Wonderful! You and your references answered all my questions. I had missed 2.6's new getsizeof() function. Yet another reason to do the 2.5-to-2.6 upgrade. Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Welcome to MultiHoster, a free image upload solution. Simply browse, select, and upload !!

2008-11-24 Thread jenny
http://www.effriend.com/index.php -- http://mail.python.org/mailman/listinfo/python-list

Re: Security implications of using open() on untrusted strings.

2008-11-24 Thread Thomas Bellman
r0g <[EMAIL PROTECTED]> wrote: > Although it's a desktop (not internet facing) app I'm a little squeamish > piping raw user input into a filesystem function like that and this app > will be dealing with some particularly sensitive data so I want to be > careful and minimize exposure where practica

RE: Sphinx 0.5 released

2008-11-24 Thread kgmuller
Happy Birthday, Georg! Thanks for a great tool! Klaus "SimPy" Muller > -Original Message- > From: Georg Brandl [mailto:[EMAIL PROTECTED] > Sent: Sonntag, 23. November 2008 19:45 > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Sphinx 0.5 released > > Hi all, > > I'm proud to anno

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-24 Thread Paul Boddie
On 24 Nov, 12:42, "Jerzy Jalocha N" <[EMAIL PROTECTED]> wrote: > > I will try to contact whoever is responsible for the packaging of Python > in Ubuntu (or Debian), and ask them if they are willing to support the > _complete_ Python release. They may already do so, but I'd argue that they could do

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Paul Boddie
On 24 Nov, 08:43, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > That doesn't really explain it. It always was os.path.extsep, > but it *also* was os.extsep. I've always known it as the former; a perusal of the Python repository would probably indicate when it became exposed in the os module its

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-24 Thread Jerzy Jalocha N
On Fri, Nov 21, 2008 at 9:37 AM, David Cournapeau <[EMAIL PROTECTED]> wrote: > I think most people using python as a development tool use the version > available in their distribution. Personally, I mostly use the stock > python of Ubuntu. Although building python itself is not difficult on > the t

Re: Python 3.0 - is this true?

2008-11-24 Thread Duncan Grisby
In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: [...] >> l = [] >> for line in open("bigfile.txt"): >> x = random.randint(0,100) >> if x < 4: l.append(None) >> else: l.append(line) > >So use '' or '\0' instead of None for null lines. Or replace None for >the s

Re: Module Structure/Import Design Problem

2008-11-24 Thread Rafe
On Nov 22, 2:39 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Thu, 20 Nov 2008 17:36:11 -0200, Stef Mientki > > <[EMAIL PROTECTED]> escribió: > > I'm not an expert, I even don't fully understand your problem, > but having struggled with imports in the past,

3.0rc3: List of 'os.', 'os.path.' attribute redundencies ... !! ?

2008-11-24 Thread bMotu
IDLE 3.0rc3 (using XP) >>> import os >>> os.altsep '/' >>> os.path.altsep '/' >>> os.curdir '.' >>> os.path.curdir '.' >>> os.defpath '.;C:\\bin' >>> os.path.defpath '.;C:\\bin' >>> os.devnull 'nul' >>> os.path.devnull 'nul' >>> os.pardir '..' >>> os.path.pardir '..' >>> os.pathsep ';' >>> o

Re: PIL (python imaging library) or Mathematics help both appreciated

2008-11-24 Thread Arnaud Delobelle
Well not much maths in my answers but... On 24 Nov, 08:52, amine <[EMAIL PROTECTED]> wrote: > well, here is the background.  I have images of objects (cars, > clothes, ...) with a white background in most of the cases > > I have to build a function with PIL that takes away the background. > it see

Re: Install modules with no root privilegies

2008-11-24 Thread Philipp Pagel
Alfons Nonell-Canals <[EMAIL PROTECTED]> wrote: > Install python modules in a linux computer is really easy, it is because > the module is a package of the distribution or because the python > installation is really easy. But, in both situations, you need root > privilegies. > I would like to know

Install modules with no root privilegies

2008-11-24 Thread Alfons Nonell-Canals
Hello, Install python modules in a linux computer is really easy, it is because the module is a package of the distribution or because the python installation is really easy. But, in both situations, you need root privilegies. I would like to know how to install modules only for one user, with no

PIL (python imaging library) or Mathematics help both appreciated

2008-11-24 Thread amine
well, here is the background. I have images of objects (cars, clothes, ...) with a white background in most of the cases I have to build a function with PIL that takes away the background. it seems simple, just look for the "white" and make it transparent but the problem is in reality much more c

  1   2   >