Re: PIL & image size reduction script

2006-03-26 Thread nikie
Philippe Martin wrote: > Hi, > > Thanks to the NG, I got the script hereunder working. > > 1) I am not certain that the call to convert does much (checking the doc) I think you only need it if your source image comes in a format that can't be stored into a jpeg file (e.g. 8-bit paletted). You'll n

Re: maximum() efficency

2006-03-26 Thread Steven Bethard
Steve R. Hastings wrote: > On Sun, 26 Mar 2006 10:34:16 -0700, Steven Bethard wrote: >> What's the original? > > def minimum(cmp, lst): > """minimum(cmp, lst) > > Returns the minimal element in non-empty list LST with elements > compared via CMP() which should return values with the same se

Re: determine file type

2006-03-26 Thread James Stroud
Mark Gibson wrote: > Is there an equivalent to the unix 'file' command? > > [mark tmp]$ file min.txt > min.txt: ASCII text > [mark tmp]$ file trunk > trunk: directory > [mark tmp]$ file compliance.tgz > compliance.tgz: gzip compressed data, from Unix > > What I really want to do is determine if a

Re: access mbx files?

2006-03-26 Thread David Isaac
"Alan Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Should I be able to access mail messages in Mahogany mail's mbx > format using the Python mailbox module? If so, can someone > please post a working example? If not, can you please > point me to documentation of the file for

Re: Bitwise OR?

2006-03-26 Thread Clemens Hepper
Okay... pythons build-in methods are quite fast. so is hex(). with about 64 kb memory i can write it with a 16 bit dictionary where the dictionary generation itself is not yet optimized: def genBitList(exp): next = lambda now: [x+'0' for x in now]+[x+'1' for x in now] result = [""] for x i

Re: Python float representation error?

2006-03-26 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > try running this in python: > > print [39.95] > > the output i get is: > [39.953] > > what's up with that? Why not start by reading the Python online tutorial? Specifically ? Alex -- http://m

Re: a problem to solve

2006-03-26 Thread Clemens Hepper
Hi, [EMAIL PROTECTED] wrote: > That's one way to do it. I did it that way because I have the > hex patterns memorized. You should be able to generate your numbers like this: number = int('001001000100100', 2) mfg - eth -- http://mail.python.org/mailman/listinfo/python-list

How to learn python if I'm very familar with C++

2006-03-26 Thread [EMAIL PROTECTED]
Hi, I've been using C++ for a few years and have developed a few projects in C++. And I'm familar with OO and template metaprogramming. There are some book like "Learning Perl". It is a little bit tedious for me, because more material in that book seems obvious for me. I want some book describe t

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread Jim Benson
On 26 Mar 2006, [EMAIL PROTECTED] wrote: > Hi, > > I've been using C++ for a few years and have developed a few projects > in C++. And I'm familar with OO and template metaprogramming. > > There are some book like "Learning Perl". It is a little bit tedious > for me, because more material in tha

Menu For The Command Line?

2006-03-26 Thread Michael Sperlle
When I bring up the command line interface, it looks like: [EMAIL PROTECTED] Then I type in some command, and it works! But there are lots of commands to type in, and I find it more and more difficult to remember them. Is there any way to build a menu of frequently-used commands, so that when I

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread [EMAIL PROTECTED]
>The book "Learning Python" worked for me (a long time C++ person). Me too. I programmed in nothing but C++ for years, but this book made learning Python easy. -- http://mail.python.org/mailman/listinfo/python-list

Re: wildcard exclusion in cartesian products

2006-03-26 Thread John Zenger
A quick fix: change your last two functions to: def generateNotMatching(A,n,P): for g in gen(A,n,P,[]): for x in g: yield x def gen(A,n,P,acc): if any(imap((lambda p: allStar(p) and notNullOrZero(p,n)), P)): yield [] else: if n==0:

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread bitshadow
[EMAIL PROTECTED] wrote: > >The book "Learning Python" worked for me (a long time C++ person). > > Me too. I programmed in nothing but C++ for years, but this book made > learning Python easy. there are tons of tutorials available on the web. if your familiar with C++ then the tutorial that comes

Re: determine file type

2006-03-26 Thread Mark Gibson
> > > import os > def test_file(filename, maxread=1024): >if os.path.isdir(filename): > return 'directory' >afile = open(filename) # open as text >for achar in afile.read(maxread): > if ord(achar) > 127: >return 'binary' >return 'text' > > Pefect, thanks! --

Re: a problem to solve

2006-03-26 Thread [EMAIL PROTECTED]
Clemens Hepper wrote: > Hi, > > [EMAIL PROTECTED] wrote: > > That's one way to do it. I did it that way because I have the > > hex patterns memorized. > > You should be able to generate your numbers like this: > > number = int('001001000100100', 2) Well, that would be another way, wouldn't it?

Re: What's the best way to learn perl for a python programmer?

2006-03-26 Thread Serge Orlov
vj wrote: > I've been given a project which requires writing scripts that need to > be run on over 3000 servers. Only about 15% of them have python > installed on them. While all/most of them will have perl. I used to work for a company with hundreds of development workstations and build/test serv

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Why not combine the two: > > I guess because (at least in source code) you're doing a loop twice > :-). I don't know what a compiler would do. I think though that the > "for i in c if test:" construct is more readable and maybe can ev

Re: How to learn python if I'm very familar with C++

2006-03-26 Thread bill pursell
[EMAIL PROTECTED] wrote: > Hi, > > I've been using C++ for a few years and have developed a few projects > in C++. And I'm familar with OO and template metaprogramming. > > There are some book like "Learning Perl". It is a little bit tedious > for me, because more material in that book seems obviou

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
On Mon, 27 Mar 2006 00:11:04 +, Paul McGuire wrote: > The doc string is not correct. The fault is mine, I'm afraid. I had thought I was copying that from an intact original version, but I must have edited it. I don't remember doing it, but I must have. To check, I went to Sourceforge and do

Re: Python has a new Logo

2006-03-26 Thread Randal L. Schwartz
> "adapt" == adapt her [EMAIL PROTECTED] com <[EMAIL PROTECTED]> writes: adapt> Yawn. Go start indenting, and stop using Perl. If Python has such a adapt> nice logo, why waste any more time with Perl? Chuck Norris can indent a Python program any way he wants, and it still works. -- Randal L

Re: access mbx files?

2006-03-26 Thread Donn Cave
Quoth "David Isaac" <[EMAIL PROTECTED]>: | "Alan Isaac" <[EMAIL PROTECTED]> wrote in message | news:[EMAIL PROTECTED] |> Should I be able to access mail messages in Mahogany mail's mbx |> format using the Python mailbox module? If so, can someone |> please post a working example? If not, can you pl

Re: Module documentation

2006-03-26 Thread Georg Brandl
Tony Burrows wrote: > Just getting to grips with Python, a great language BUT > With something like Java I can find the syntax of a method call with no > problems, how do I do the same with Python? > > For example, using MySQLdb or SGMLParser I can see what the available > methods are with dir, bu

Nevow LivePage tutorial

2006-03-26 Thread Mir Nazim
Hello, Can any one direct me to some tutorials for: 1. Nevow LivePage 2. Form handling in Nevow Any Help is greately appriciated. I have already googled for it but did not get any thing helpfull. Thankyou -- http://mail.python.org/mailman/listinfo/python-list

Re: Firedrop 0.2.0 - The Python Blog Client

2006-03-26 Thread Fuzzyman
Kent Johnson wrote: > Fuzzyman wrote: > > It has finally happened, the release of `Firedrop 0.2.0 > > > * `ConfigObj `_ is > > now used to edit all the config files. > > You should add this to the dependency list in the install page, it > tripped

Re: OT: unix newbie questions

2006-03-26 Thread Joel Hedlund
> * I'm using the tcsh shell and have no problems with it, but bash seems > more popular - any reason to change? (I don't intend writing many shell > scripts) You can do this in bash: $ python myprog > stdout.txt 2> stderr.txt and have output to sys.stdout and sys.stderr go in separate files.

vxWorks port?

2006-03-26 Thread Miki
Hello All, I saw some old posts about vxWorks port of Python. Is there someone who can give me pointers to more recent efforts of porting Python to wxWorks? Thanks, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: New-style Python icons

2006-03-26 Thread Robin Becker
Steven Bethard wrote: ... >> >> http://www.doxdesk.com/img/software/py/icons.zip > > I just wanted to say that I've been using these icons for almost a week > now and I love them! I'd like to reiterate EuGeNe's request that these > go into the Python 2.5 release if at all possible. > > S

Re: HIRING: PHP Developer

2006-03-26 Thread Skeets
flash is over rated. rethink that requirement. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2