[ANN] rpncalc-2.1 RPN Calculator for Python

2005-09-11 Thread Raymond L. Buvel
The rpncalc package adds an interactive Reverse Polish Notation (RPN) interpreter to Python. This interpreter allows the use of Python as an RPN calculator. You can easily switch between the RPN interpreter and the standard Python interpreter. Home page: http://calcrpnpy.sourceforge.net/

[ANN] ratfun-2.1 Polynomials and Rational Functions

2005-09-11 Thread Raymond L. Buvel
The ratfun module provides classes for defining polynomial and rational function (ratio of two polynomials) objects. These objects can be used in arithmetic expressions and evaluated at a particular point. Home page: http://calcrpnpy.sourceforge.net/ratfun.html Note: If you are using

Re: getting words from readline

2005-09-11 Thread Do Re Mi chel La Si Do
Hi ! Look : .split() @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: getting words from readline

2005-09-11 Thread Steve Holden
Adam wrote: How is best to extract word strings from a line = infile.readline() I wish to quickly check the first word of each line of a text file. Indeed, How do I break a lineinput() line into component words (separate by spaces etc) ? Should I be looking at; Re Parser Slice

issue with string.Template

2005-09-11 Thread Michele Simionato
This is somewhat in between a bug report and a feature request. I was using the new string.Template class and I have run into a few issues that I traced back to the usage of the idiom '%s' % val in the 'convert' helper function in Template.substitute. I do not understand why '%s' % val was used

Re: getting words from readline

2005-09-11 Thread Adam
Ouch. That is simple with .split I must have got confused amongst slice re etc. searching searching. Thanks folks. Painless. -- http://mail.python.org/mailman/listinfo/python-list

Re: issue with string.Template

2005-09-11 Thread Peter Otten
Michele Simionato wrote: from string import Template as T T($obj).substitute(obj=()) TypeError: not enough arguments for format string So, take this as a bug report if the behavior is not intended and as a feature request if the current behaviour is the intended one ;) I vote for bug

Re: Question about consistency in python language

2005-09-11 Thread James
Also, you shouldn't use 1, I mean l, as a variable name. It gets confusing because l, I mean 1, looks a lot like 1, I mean l. I have seen the same warnning above significantly several times. Is this problem originally came from the similarities between 'l' and '1' or from bad looking

Re: List of integers L.I.S. (SPOILER)

2005-09-11 Thread n00m
Tim Peters; INCREDIBLE~ 241433 2005-09-11 04:23:40 Tim Peters accepted 3.44 7096 PYTH BRAVO! I just wonder have I grey cells enough for to understand how your algo works... and hopefully it's not your last solved problem on the contester. I'm pretty sure they're using slower HW than mine

regex re.search and re.match

2005-09-11 Thread Xah Lee
in the regex module re: Note: Match() is not exactly equivalent to Search() with ^. For example: re.search(r'^B', 'A\nB',re.M) # succeeds re.match(r'B', 'A\nB',re.M) # fails if without the re.M, would re.search and re.match be equivalent? i wish to spruce up the rewritten

Re: Question about consistency in python language

2005-09-11 Thread Kay Schluehr
Steve Holden wrote: Kay Schluehr wrote: Mike Meyer wrote: Yes, but the function sorted is more useful than a list method sorted in a duck typing language. I don't see what this has to do with duck typing? sorted() is simply a generic function accepting different types. I'm not

Re: Python linear algebra module -- requesting comments on interface

2005-09-11 Thread Szabolcs Nagy
nice interface, but with 3d apps i prefer cgkit's approach, which has vec3, vec4, mat3, mat4 and quat types with lots of useful functions for 3d graphics (like mat4.looakAt(pos, target, up) or mat3.toEulerXYZ()) there are other libs with similar types and functions: cgkit

Re: Question about consistency in python language

2005-09-11 Thread Robert Kern
James wrote: [James Stroud wrote:] Also, you shouldn't use 1, I mean l, as a variable name. It gets confusing because l, I mean 1, looks a lot like 1, I mean l. I have seen the same warnning above significantly several times. Is this problem originally came from the similarities between 'l'

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-11 Thread Mike P.
On Fri, 9 Sep 2005 13:55:03 -0700, Trent Mick wrote: [Mike Meyer wrote] stri ker [EMAIL PROTECTED] writes: Has anyone here upgraded from 2.3 to 2.4 on Tiger? If so how'd ya do it? You don't. You install 2.4 in parallel with 2.3. You can do pretty much whatever you want with

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-11 Thread Robert Kern
Mike P. wrote: Which one should I go for? What are other people using (i.e. which is the most popular version)? Any particular advantages/disadvantages for each version? The official one. http://python.org/2.4.1/ -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass

Predicting Thumbnail Sizes from PIL

2005-09-11 Thread Roger
I need to calculate the thumbnail sizes PILL will produce from an image. In most cases I can divide and round by adding .5, but PIL seems to round differently on odd sized images. For example, I want to reduce an 800x816 image to have a maximum size of 697. (697/816) * 800 = 683.33, so my

Re: Predicting Thumbnail Sizes from PIL

2005-09-11 Thread Fredrik Lundh
Roger wrote: I need to calculate the thumbnail sizes PILL will produce from an image. In most cases I can divide and round by adding .5, but PIL seems to round differently on odd sized images. For example, I want to reduce an 800x816 image to have a maximum size of 697. (697/816) * 800 =

ANNOUNCE: twill 0.7.2

2005-09-11 Thread C. Titus Brown
ANNOUNCING twill v0.7.2. twill is a simple Web scripting language built on top of Python and John J. Lee's 'mechanize'. It's designed for automated testing of Web sites, but it should prove useful for anybody who needs to interact with Web sites (especially those using logins and cookies) on the

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Carl Friedrich Bolz
Hi! adDoc's networker Phil wrote: experimental Python-to-C++ compiler. why that instead of Pypy? . pypy compiles to llvm (low-level virtual machine) bytecode which is obviously not as fast as the native code coming from c++ compilers; PyPy can currently compile Python code to

Re: python callbacks and windows

2005-09-11 Thread davidstummer
anybody? -- http://mail.python.org/mailman/listinfo/python-list

Re: encryption with python

2005-09-11 Thread Ron Adam
Kirk Job Sluder wrote: Ron Adam [EMAIL PROTECTED] writes: I would think that any n digit random number not already in the data base would work for an id along with a randomly generated password that the student can change if they want. The service provider has full access to the data with

First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Mark Dufour
After nine months of hard work, I am proud to introduce my baby to the world: an experimental Python-to-C++ compiler. Wow, looks really cool. But why that instead of Pypy? I agree with anyone that a JIT compiler that supports the full Python semantics (which I thought to be the goal of PyPy?)

Creating BibTex files with XdkBibTeX

2005-09-11 Thread Rob Cowie
I'm looking for a module that is able to create valid BibTex documents. I'm currently using string substitution to create the content, but it is not validated in any way. The only BibTex creation module available in Python (that I can find) is XdkBibTeX

Re: Why do Pythoneers reinvent the wheel?

2005-09-11 Thread Bruno Desthuilliers
Stefano Masini a écrit : (snip) If such a quick and dirty section existed, I think it would also become a natural randevouz point for innovators. s/randevouz/rendez-vous/ !-) pardon-my-french-ly y'rs -- http://mail.python.org/mailman/listinfo/python-list

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Paul Boddie
Carl Friedrich Bolz wrote: . there is no reason why the pypy project can't have a .NET architecture instead of the java-like arrangement I assume it has now Sorry, I can't really follow you here. In what way does PyPy have a Java-like arrangement? I imagine that this remark was made in

Re: List of integers L.I.S. (SPOILER)

2005-09-11 Thread Tim Peters
[Tim Peters, on the problem at http://spoj.sphere.pl/problems/SUPPER/ ] ... [EMAIL PROTECTED] INCREDIBLE~ 241433 2005-09-11 04:23:40 Tim Peters accepted 3.44 7096 PYTH BRAVO! It's different now ;-) I added the two lines import psyco psyco.full() and time dropped to 2.29, while

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Michael Sparks
Mark Dufour wrote: With this initial release, I hope to attract other people to help me locate remaining problems, Well, you did say you want help with locating problems. One problem with this is it doesn't build... If I try and build (following your instructions), I get presented with a

Re: Python versus Perl

2005-09-11 Thread Michael Sparks
Terry Reedy wrote: [...] I am being picky because various people have claimed that Python suffers in popularity because it is known as an 'interpreted language'. So maybe advocates should be more careful than we have been to not reinforce the misunderstanding. I sometimes wonder if it might

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Carl Friedrich Bolz
Hi Paul! Paul Boddie wrote: Carl Friedrich Bolz wrote: . there is no reason why the pypy project can't have a .NET architecture instead of the java-like arrangement I assume it has now Sorry, I can't really follow you here. In what way does PyPy have a Java-like arrangement? I imagine that

Re: make sure entire string was parsed

2005-09-11 Thread Steven Bethard
Paul McGuire wrote: Thanks for giving pyparsing a try! To see whether your input text consumes the whole string, add a StringEnd() element to the end of your BNF. Then if there is more text after the parsed text, parseString will throw a ParseException. Thanks, that's exactly what I was

pinging from within python

2005-09-11 Thread M.N.A.Smadi
hi; I need a simple script to run the ping command with some parameters and be able to read the return value of the ping function. Any pointers will be appreciated thanks m.smadi -- http://mail.python.org/mailman/listinfo/python-list

Re: pinging from within python

2005-09-11 Thread Grant Edwards
On 2005-09-11, M.N.A.Smadi [EMAIL PROTECTED] wrote: I need a simple script to run the ping command with some parameters and be able to read the return value of the ping function. Any pointers will be appreciated http://www.google.com/search?hl=enq=python+ping -- Grant Edwards

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Paul Boddie
Michael Sparks wrote: Well, you did say you want help with locating problems. One problem with this is it doesn't build... I found that I needed both the libgc and libgc-dev packages for my Kubuntu distribution - installing them fixed the include issues that you observed - and it does appear to

Re: Python versus Perl

2005-09-11 Thread Terry Reedy
Michael Sparks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] That said, if you do describe it that way, it'd be more accurate to describe the python binary as a compiler/runtime rather than interpreter since it'd be more accurate. If Java calls its runtime bytecode

Re: Question about consistency in python language

2005-09-11 Thread Terry Reedy
Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In many, many fonts 'l' and '1' look close enough to be easily mistaken for one another In the default font used by Outlook Express, displayed on my 1078x786 screen, the only difference I can see, using a magnifying glass

CGIHTTPServer, popen3, and windoze

2005-09-11 Thread Fuzzyman
Hello all, I may well post this a a bug on Monday (after testing with Python 2.3) - but I thought I'd post here to see if anyone has any ideas. The basic problem is that under Python 2.4 (and windoze XP SP2) CGIHTTPServer isn't passing the CGI environment variables to scripts it runs. I've

ANNOUNCE: SMC - State Machine Compiler v. 4.2.0

2005-09-11 Thread rapp
SMC - The State Machine Compiler v. 4.2.0 Requires: Java 1.4.1 SE (Standard Edition) or better. Download: http://sourceforge.net/projects/smc Home Page: http://smc.sourceforge.net = What's New?

Re: Predicting Thumbnail Sizes from PIL

2005-09-11 Thread Fuzzyman
Fredrik Lundh wrote: [snip..] the algorithm is: x, y = im.size if x size[0]: y = max(y * size[0] / x, 1); x = size[0] if y size[1]: x = max(x * size[1] / y, 1); y = size[1] size = x, y that is, it shrinks the image horizontally first, and it then shrinks the resulting

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread A.B., Khalid
Mark Dufour wrote: After nine months of hard work, I am proud to introduce my baby to the world: an experimental Python-to-C++ compiler. Good work. I have good news and bad news. First the good news: ShedSkin (SS) more or less works on Windows. After patching gc6.5 for MinGW, building it, and

Re: unicode, C++, python 2.2

2005-09-11 Thread Martin v. Löwis
Trond Eivind Glomsrød wrote: I am currently writing a python interface to a C++ library. Some of the functions in this library take unicode strings (UTF-8, mostly) as arguments. However, when getting these data I run into problem on python 2.2 (RHEL3) - while the data is all nice UCS4 in

Re: calling command line programs?

2005-09-11 Thread chriss
Grant Edwards wrote: On 2005-09-10, chriss [EMAIL PROTECTED] wrote: Take a look at os.popen, os.spawn, or the popen2, and subprocess modules. That last one seems to be gaining popularity. The suggested modules and functions have been deprecated according to the python 2.4 docs. The doc

packaging python for install.

2005-09-11 Thread J
Hi everyone, I have created an App that embedds the python interpreter and I am now in the process of creating an installer. I am currently linking python24.lib, but it is only 184k and I suspect that it imports other dlls... I am also using numarray. Does anyone have any experiences in packaging

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Carl Friedrich Bolz
Hi Mark! Mark Dufour wrote: After nine months of hard work, I am proud to introduce my baby to the world: an experimental Python-to-C++ compiler. Wow, looks really cool. But why that instead of Pypy? I agree with anyone that a JIT compiler that supports the full Python semantics (which I

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-11 Thread Mike Meyer
Mike P. [EMAIL PROTECTED] writes: I just got a Mac and was wondering the same thing as the original poster - how to move to 2.4, but I found out there was more than one version. So in addition to the Apple installation of 2.3, there are 4 versions of Python 2.4 (ActivePython, MacPython,

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Michael Sparks
Paul Boddie wrote: Michael Sparks wrote: Well, you did say you want help with locating problems. One problem with this is it doesn't build... I found that I needed both the libgc and libgc-dev packages for my Kubuntu distribution - installing them fixed the include issues that you

Re: Fun with decorators and unification dispatch

2005-09-11 Thread Talin
Well, the Matrix matching function now works as described above: @Arity( MatchMatrix( MatchInteger.n, MatchInteger.n ).x ) Now I am trying to see if I can write the rules for Derviative()... -- http://mail.python.org/mailman/listinfo/python-list

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-11 Thread Robert Kern
Mike Meyer wrote: Depends on what you want to do with it. If you favor one of the package systems (fink, darwinports, emerge), you probably want to use that one. That way, you won't have to worry about whether or not another package from that system will find the one Python you installed

Re: make sure entire string was parsed

2005-09-11 Thread Paul McGuire
Steve - I have to differentiate between: (NP -x-y) and: (NP-x -y) I'm doing this now using Combine. Does that seem right? If your word char set is just alphanums+-, then this will work without doing anything unnatural with leaveWhitespace: from pyparsing import * thing =

Re: python callbacks and windows

2005-09-11 Thread Bengt Richter
On 9 Sep 2005 03:20:09 -0700, [EMAIL PROTECTED] wrote: I was wondering if anyone could point me to an example. Currently i have a c++ program which calls and c++ dll (i created both). The dll uses SendMessage to pass messages back to the calling .exe, and the .exe process the messages in it's

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-11 Thread Paul Boddie
Carl Friedrich Bolz wrote: a) building LLVM is not _that_ bad (you don't need to build the C-frontend, which is the really messy part) That piece of wisdom must have passed me by last time, when I probably heeded the scary warning from the configure script and made the mistake of getting the C

Re: pinging from within python

2005-09-11 Thread billiejoex
Impacket module can helps you to construct the ip/icmp packet structure, then you can send the packet and wait for the ECHOREPLY by using a RAW_SOCKET. Here's an example: http://oss.coresecurity.com/impacket/ping.py Cheers I need a simple script to run the ping command with some parameters

Re: List of integers L.I.S. (SPOILER)

2005-09-11 Thread Bryan Olson
Tim Peters wrote: [Bryan Olson, on the problem at http://spoj.sphere.pl/problems/SUPPER/ ] I never intended to submit this program for competition. The contest ranks in speed order, and there is no way Python can compete with truly-compiled languages on such low-level code. I'd bet

Re: List of integers L.I.S. (SPOILER)

2005-09-11 Thread Tim Peters
[Tim Peters, on the problem at http://spoj.sphere.pl/problems/SUPPER/ ] Oh, it's not that bad wink. I took a stab at a Python program for this, and it passed (3.44 seconds). ... I didn't make any effort to speed this, beyond picking a reasonable algorithm, so maybe someone else can

Re: issue with string.Template

2005-09-11 Thread Raymond Hettinger
Michele Simionato wrote: This is somewhat in between a bug report and a feature request. I was using the new string.Template class and I have run into a few issues that I traced back to the usage of the idiom '%s' % val in the 'convert' helper function in Template.substitute. I do not

Re: python callbacks and windows

2005-09-11 Thread A.B., Khalid
[EMAIL PROTECTED] wrote: I was wondering if anyone could point me to an example. Currently i have a c++ program which calls and c++ dll (i created both). The dll uses SendMessage to pass messages back to the calling .exe, and the .exe process the messages in it's Windows Procedure function

libgmail login failure

2005-09-11 Thread kevincw01
There doesnt seem to be a reliable support channel for libgmail so i figured this group might have some people who could help. I have the latest version(from cvs) of libgmail.py, lgconstants.py and mkconstants.py with python version 2.3.3. gmailfs fails with a login error. I also tried a test