Re: Python compiled?

2005-09-10 Thread Paul Rubin
Tim Roberts <[EMAIL PROTECTED]> writes: > I doubt it. C#, VB.NET, VBscript, Javascript and Perl have not suffered > from being interpreted. Are you kidding? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Tim Daneliuk
Stefano Masini wrote: > On 10 Sep 2005 02:10:59 EDT, Tim Daneliuk <[EMAIL PROTECTED]> wrote: > >>As someone who implemented their own configuration mini-language >>with validation, blah, blah, blah >>(http://www.tundraware.com/Software/tconfpy/) > > > Well, a configuration mini language with v

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Kay Schluehr
Tim Daneliuk wrote: > 1) The existing tool is inadequate for the task at hand and OO subclassing > is overrated/overhyped to fix this problem. Even when you override > base classes with your own stuff, you're still stuck with the larger > *architecture* of the original design. You real

Re: Create new instance of Python class in C

2005-09-10 Thread Sybren Stuvel
phil hunt enlightened us with: > Why do you need to maske lots of copies? The puzzles are stored in a NxN list of strings. The strings contain all the numerals that that block can contain. So a 9x9 puzzle contains 81 strings "123456789" when it's "empty". My creation function picks a block that i

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Stefano Masini
On 10 Sep 2005 03:16:02 EDT, Tim Daneliuk <[EMAIL PROTECTED]> wrote: > frameworks are unlikely to serve them well as written. I realize this is > all at a level of complexity above what you had in mind, but it's easy > to forget that a significant portion of the world likes/needs/benefits > from th

execute commands and return output

2005-09-10 Thread billiejoex
Hi all. I'm searching for a portable (working on *nix and win32) function that executes a system command and encapsulate its output into a string. Searching for the web I found this: os.popen('command').read() It is perfect but when che command return an error the funciotn returns an empy strin

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

2005-09-10 Thread n00m
Bryan Olson wrote: > Could be. Yet you did write: >> It's incredibly fast! I just was obliged to exclaim "It's incredibly fast!" because I THOUGHT your first version handled ALL TEN testcases from the input. But the code read from the *20-lines* input *ONLY 2* its first lines. Usually they pl

Re: nested tuples

2005-09-10 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 | | Why? What is it about the list of tuples that you don't like? | Philosophically, it's more in line with Guido's separation of list and | tuple. I'm not saying that I don't like, I was just curious to know if there was a way to do it using exclusi

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Tim Daneliuk
Kay Schluehr wrote: > Tim Daneliuk wrote: > > >>1) The existing tool is inadequate for the task at hand and OO subclassing >>is overrated/overhyped to fix this problem. Even when you override >>base classes with your own stuff, you're still stuck with the larger >>*architecture* of t

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Tim Daneliuk
Stefano Masini wrote: > On 10 Sep 2005 03:16:02 EDT, Tim Daneliuk <[EMAIL PROTECTED]> wrote: > >>frameworks are unlikely to serve them well as written. I realize this is >>all at a level of complexity above what you had in mind, but it's easy >>to forget that a significant portion of the world li

Re: execute commands and return output

2005-09-10 Thread Leif K-Brooks
billiejoex wrote: > Hi all. I'm searching for a portable (working on *nix and win32) function > that executes a system command and encapsulate its output into a string. > Searching for the web I found this: > > os.popen('command').read() > > It is perfect but when che command return an error the

Re: execute commands and return output

2005-09-10 Thread Fredrik Lundh
"billiejoex" wrote: > Hi all. I'm searching for a portable (working on *nix and win32) function > that executes a system command and encapsulate its > output into a string. > Searching for the web I found this: > > os.popen('command').read() > > It is perfect but when che command return an error

Re: execute commands and return output

2005-09-10 Thread billiejoex
Thank you for your help but I'm searching a different way. Moreover it doesn't work always (for exaple: try a 'dir' command). Because of I'm implementing a remote shell the [[os.popen('command').read()]] rapresents the best for me because it can also accepts arguments direclty (for example: os

Re: execute commands and return output

2005-09-10 Thread Do Re Mi chel La Si Do
Hi ! Look (the doc for) Popen2, Popen3, Popen4 & Subprocess @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: execute commands and return output

2005-09-10 Thread Fredrik Lundh
"billiejoex" wrote: > Moreover it doesn't work always (for exaple: try a 'dir' command). why use os.system("dir") when Python already offers things like os.listdir, os.walk, and glob.glob ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Design Principles

2005-09-10 Thread Fredrik Lundh
"[EMAIL PROTECTED]" wrote: > After all, the fact that Python is not strongly typed and is > interpreted rather than compiled if you think those are facts, you don't understand how Python works. (hint: Python's both strongly typed *and* compiled) > sacrificing programmer producitivity the abili

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread A.M. Kuchling
On Sat, 10 Sep 2005 08:53:24 +0200, Stefano Masini <[EMAIL PROTECTED]> wrote: > Well, so we might as well learn a little more and rewrite os.path, the > time module and pickle. Right? :) And in fact people have done all of these: os.path: path.py (http://www.jorendorff.com/articles/python

Re: execute commands and return output

2005-09-10 Thread Leif K-Brooks
billiejoex wrote: > Thank you for your help but I'm searching a different way. > Moreover it doesn't work always (for exaple: try a 'dir' command). > Because of I'm implementing a remote shell the > [[os.popen('command').read()]] rapresents the best for me because it can > also accepts arguments

Re: global interpreter lock

2005-09-10 Thread Paul Rubin
Michael Sparks <[EMAIL PROTECTED]> writes: > > But I think to do it on Erlang's scale, Python needs user-level > > microthreads and not just OS threads. > > You've just described Kamaelia* BTW, except substitute micro-thread > with generator :-) (Also we call the queues outboxes and inboxes, and

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-10 Thread Andrew MacIntyre
On Fri, 09 Sep 2005 08:36:00 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: {...} >(I have released and announced this 3 weeks ago, but haven't got a >single feedback. So it seems the need to access custom interfaces is >very low.) I have downloaded it and am trying to find the time to play wi

Re: execute commands and return output

2005-09-10 Thread tiissa
billiejoex wrote: > Hi all. I'm searching for a portable (working on *nix and win32) function > that executes a system command and encapsulate its output into a string. > Searching for the web I found this: > > os.popen('command').read() > > It is perfect but when che command return an error the

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Fuzzyman
Michael Amrhein wrote: > Stefano Masini schrieb: > > On 8 Sep 2005 08:24:50 -0700, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > >>What is pythonutils ? > >>= > >>ConfigObj - simple config file handling > >>validate - validation and type conversion system > >>listquote - string to

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Martin P. Hellwig
Stefano Masini wrote: Although I'm not experienced enough to comment on python stuff itself I do know that in general there are 2 reasons that people reinvent the wheel: - They didn't know of the existence of the first wheel - They have different roads Those reasons can even be combined. The m

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Paul Boddie
A.M. Kuchling wrote: > PEP 206 (http://www.python.org/peps/pep-0206.html) suggests assembling an > advanced library for particular problem domains (e.g. web programming, > scientific programming), and then providing a script that pulls the relevant > packages off PyPI. I'd like to hear suggestions

Re: The penis is way too delicate for masturbation

2005-09-10 Thread Tux Wonder-Dog
Chucky & Janica wrote: > Once upon a time - for example, 1 Sep 2005 05:32:54 -0700 - there was > this guy, or something, called [EMAIL PROTECTED], and they made us > all feel better by saying the following stuff: > >>. > > That penis, more to the point, is too small for masturbation. > > > >

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Tom
Peter Hansen wrote: > Tom wrote: > >>I'm having a problem using a path with spaces as a parameter to >>os.rename() in a program on WinXP. >> >>This works fine at the command line (where the folder "c:\aa bb" exists) >> >> > os.rename( "c\aa bb", "c:\cc dd" ); >> > >> >>But, I can't get it to work

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Tom
Yes, I am sure about those things. I've tried shutil.move and got the same result. Forward slash? I'll give that a try and report back here if it works. Thanks, Tom. Larry Bates wrote: > Are you sure the source directory exists and you > have rights to rename it? Because the rename works > for

How to handle very large MIME Messages with the email package?

2005-09-10 Thread [EMAIL PROTECTED]
Looking at the email package, it seems all the MIMExxx classes takes string but not file object as the payload. I need to handle very large MIME messages say up to 100M. And possibly many of them. Is email package sufficient. If not is it possible to extend it? Looking at a previous thread it seem

Re: nested tuples

2005-09-10 Thread Terry Reedy
"Luis P. Mendes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > | Why? What is it about the list of tuples that you don't like? > | Philosophically, it's more in line with Guido's separation of list and > | tuple. > I'm not saying that I don't like, I was just curious to know if t

Re: Python compiled?

2005-09-10 Thread Terry Reedy
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "billiejoex" <[EMAIL PROTECTED]> wrote: >> >>Hi all. I'm sorry for a noob question like this but I'll try to ask it >>anyway. >>One of the greatest problem that may discourage a new user to choose >>Python >>language is

Re: What's the difference between VAR and _VAR_?

2005-09-10 Thread Michael Ekstrand
On 8 Sep 2005 22:48:05 -0700 "Johnny Lee" <[EMAIL PROTECTED]> wrote: > I thought there must be something special when you named a VAR with > '_' the first character. Maybe it's just a programming style and I had > thought too much... It is just a programming style issue. In Python, variables and f

Re: OpenSource documentation problems

2005-09-10 Thread Michael Ekstrand
On Fri, 09 Sep 2005 18:16:36 -0400 Mike Meyer <[EMAIL PROTECTED]> wrote: > You need a better browser. Mine - at least on Unix - have an option to > dump textareas into text files, invoke my favorite editor on them, and > then read the file back in when the editor exits. Assuming i'm not > running t

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Peter Hansen
Tom wrote: > Drive E: is removable, so I was careful to verify that that was a factor > in the problem. > > Yes, I can do the same renaming, with the same drive, at the command line. > > I think I put the emphasis in the wrong place in my question. This > isn't really about os.rename(). It is

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Mike Meyer
Stefano Masini <[EMAIL PROTECTED]> writes: > It would be great if there was a section in the Python manual like this: > > "Quick and Dirty: Commonly needed tricks for real applications" > > 1. odict > 2. file system management > 3. xml (de)serialization > 4. ... > > Each section would describe the

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Tim Daneliuk <[EMAIL PROTECTED]> wrote: > >IMHO, one of Python's greatest virtues is its ability to shift paradigms >in mid-program so that you can use the model that best fits your problem >space. IOW, Python is an OO language that doesn't jam it down your >throat,

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Dave Brueck <[EMAIL PROTECTED]> wrote: > >Many projects (Python-related or not) often seem to lack precisely >what has helped Python itself evolve so well - a single person with >decision power who is also trusted enough to make good decisions, such >that when disag

Re: execute commands and return output

2005-09-10 Thread billiejoex
Thanks for suggestions. I'll try one of these solutions soon. -- http://mail.python.org/mailman/listinfo/python-list

Unusual Python Sighting

2005-09-10 Thread Scott David Daniels
In article: http://humorix.org/articles/2005/08/notice/ ... 6. The use of semantically significant whitespace in Python® programs might be protected by intellectual property laws in five (5) countries, --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mai

Re: OpenSource documentation problems

2005-09-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Michael Ekstrand <[EMAIL PROTECTED]> wrote: >On Fri, 09 Sep 2005 18:16:36 -0400 >Mike Meyer <[EMAIL PROTECTED]> wrote: >> >> You need a better browser. Mine - at least on Unix - have an option to >> dump textareas into text files, invoke my favorite editor on them,

IDisatch and pythoncom

2005-09-10 Thread Manu
Hi, I have a COM component server that just exposes the IDispatch interface but when you use it in a VB app you can access other method. I think the way to access the other methods( as does it VBA for ex) is to use Invoke but don't know how to do it in python. Say for ex i want to convert this

Re: Python versus Perl

2005-09-10 Thread Thorsten Kampe
* Dieter Vanderelst (2005-09-06 18:03 +0100) > I'm currently comparing Python versus Perl to use in a project that > involved a lot of text processing. I'm trying to determine what the most > efficient language would be for our purposes. I have to admit that, > although I'm very familiar with Py

Re: OpenSource documentation problems

2005-09-10 Thread Mike Meyer
Michael Ekstrand <[EMAIL PROTECTED]> writes: > On Fri, 09 Sep 2005 18:16:36 -0400 > Mike Meyer <[EMAIL PROTECTED]> wrote: >> You need a better browser. Mine - at least on Unix - have an option to >> dump textareas into text files, invoke my favorite editor on them, and >> then read the file back i

pydoc search in browser

2005-09-10 Thread Sakcee
Hi I am a newbie to pydoc and I need some help. I would really appreciate if some one can tell me how to add search box in a page generated by pydoc, e.g. I want to add serch like the one in pydoc.org thanks sakcee -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-10 Thread Joakim Persson
On Fri, 09 Sep 2005 08:36:00 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: >Sounds like a perfect job for comtypes, which is a COM library >implemented in pure Python, based on ctypes. comtypes should make it >easy to access custom (non-dispatch derived) com interfaces, or the >vtable based par

Re: IDisatch and pythoncom

2005-09-10 Thread Do Re Mi chel La Si Do
Hi ! Perhaps : .Dispactch vs .Dispatch ? @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Unusual Python Sighting

2005-09-10 Thread [EMAIL PROTECTED]
Scott David Daniels wrote: > In article: > http://humorix.org/articles/2005/08/notice/ > > ... 6. The use of semantically significant whitespace in Python® > programs might be protected by intellectual property laws in > five (5) countries, > > --Scott David Daniels > [EMA

Re: encryption with python

2005-09-10 Thread Kirk Job Sluder
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 07 Sep 2005 14:31:03 -0700, jlocc wrote: > > > Basically I will like to combine a social security number (9 digits) > > and a birth date (8 digits, could be padded to be 9) and obtain a new > > 'student number'. It would be better if the origi

Re: Python versus Perl

2005-09-10 Thread Roy Smith
Dieter Vanderelst <[EMAIL PROTECTED]> wrote: > 1 - How does the speed of execution of Perl compares to that of Python? To a first-order approximation, Perl and Python run at the same speed. They are both interpreted languages with roughly the same kind of control flow and data structures. The

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Bengt Richter
On Sat, 10 Sep 2005 16:55:51 +0200, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: >Stefano Masini wrote: > > >Although I'm not experienced enough to comment on python stuff itself I >do know that in general there are 2 reasons that people reinvent the wheel: >- They didn't know of the existenc

Re: Python compiled?

2005-09-10 Thread Robert Kern
Terry Reedy wrote: > "Tim Roberts" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>"billiejoex" <[EMAIL PROTECTED]> wrote: >> >>>Hi all. I'm sorry for a noob question like this but I'll try to ask it >>>anyway. >>>One of the greatest problem that may discourage a new user to cho

Find roots of ill-conditioned polynomials

2005-09-10 Thread Raymond L. Buvel
If you are using the root finder in Numeric, and are having problems, check out the root finder in the ratfun module. My testing indicates that it will give the exact roots of a Wilkinson polynomial of degree 100. For more information see http://calcrpnpy.sourceforge.net/ratfun.html -- http://m

Re: encryption with python

2005-09-10 Thread Kirk Job Sluder
Paul Rubin writes: > Kirk Job Sluder <[EMAIL PROTECTED]> writes: > > Well, there is a form of security design that involves one-way > > encryption of confidential information. You might want to be able to > > search on SSN, but not have the actual SSN stored in the data

calling command line programs?

2005-09-10 Thread Yevgeniy (Eugene) Medynskiy
Hi all, This is probably a very newbie question, but after searching google and docs @ python.org I can't find an answer, so maybe someone would be able to help? I'd like to call command-line functions from my python script (like you would in perl using backticks)... Is there a way of doing th

class 'Exception', unable to use 'super' to call superclass initializer

2005-09-10 Thread chriss
Hi, environment: Python 2.4, GNU/Linux, kernel 2.6.12.2 having subclassed 'Exception' I'm trying to call the initialiser __init__(...) of the superclass Exception with 'super(..).__init__(..)' . However, trying to do so results in a 'TypeError: super() argument 1 must be type, not classobj'. Now

Re: encryption with python

2005-09-10 Thread Paul Rubin
Kirk Job Sluder <[EMAIL PROTECTED]> writes: > You have a client on the phone who needs access to information, but has > forgotten or lost the 10-digit unique ID and the PIN you gave them two > years ago. How do you provide that client with the information he or > she needs? This is the kind of di

Make Even More $$$$$ with! GreenZap! Get $25.00 for signing up/$5 for thoose u refer

2005-09-10 Thread Make More With GreenZap (Better than PayPal)get $25.00/signing up + $5.00/thoose you refer!!!
Make $10,000 in 30 days with GreenZap|Get Paid $25.00/signin up! & get paid $5.00/thoose you refer!!! Pay Automated!!! This really does work and is also totally legal and free for anyone to join. Sign up now for free and get $25 instantly into your new account. Why this works Unlike the Pay

Re: calling command line programs?

2005-09-10 Thread Grant Edwards
On 2005-09-11, Yevgeniy (Eugene) Medynskiy <[EMAIL PROTECTED]> wrote: > This is probably a very newbie question, but after searching > google and docs @ python.org I can't find an answer, so maybe > someone would be able to help? > > I'd like to call command-line functions from my python script >

Re: class 'Exception', unable to use 'super' to call superclass initializer

2005-09-10 Thread Robert Kern
chriss wrote: > Hi, > > environment: Python 2.4, GNU/Linux, kernel 2.6.12.2 > > having subclassed 'Exception' I'm trying to call the initialiser > __init__(...) of the superclass Exception with 'super(..).__init__(..)' . > However, trying to do so results in a > 'TypeError: super() argument 1 mus

Re: class 'Exception', unable to use 'super' to call superclass initializer

2005-09-10 Thread Peter Hansen
chriss wrote: > Hi, > > environment: Python 2.4, GNU/Linux, kernel 2.6.12.2 > > having subclassed 'Exception' I'm trying to call the initialiser > __init__(...) of the superclass Exception with 'super(..).__init__(..)' . > However, trying to do so results in a > 'TypeError: super() argument 1 mus

Re: calling command line programs?

2005-09-10 Thread Robert Kern
Yevgeniy (Eugene) Medynskiy wrote: > Hi all, > > This is probably a very newbie question, but after searching google and > docs @ python.org I can't find an answer, so maybe someone would be able > to help? http://docs.python.org/lib/module-subprocess.html -- Robert Kern [EMAIL PROTECTED] "I

Re: encryption with python

2005-09-10 Thread Kirk Job Sluder
Paul Rubin writes: > Kirk Job Sluder <[EMAIL PROTECTED]> writes: > We're told there is already a secure database in the picture > somewhere, or at least one that unescapeably contains cleartext SSN's, > so that's the system that should assign the ID numbers and handle >

Re: calling command line programs?

2005-09-10 Thread chriss
Grant Edwards wrote: > On 2005-09-11, Yevgeniy (Eugene) Medynskiy <[EMAIL PROTECTED]> wrote: > >> This is probably a very newbie question, but after searching >> google and docs @ python.org I can't find an answer, so maybe >> someone would be able to help? >> >> I'd like to call command-line fun

Re: class 'Exception', unable to use 'super' to call superclass initializer

2005-09-10 Thread chriss
Peter Hansen wrote: > chriss wrote: >> Hi, >> >> environment: Python 2.4, GNU/Linux, kernel 2.6.12.2 >> >> having subclassed 'Exception' I'm trying to call the initialiser >> __init__(...) of the superclass Exception with 'super(..).__init__(..)' . >> However, trying to do so results in a >> 'Ty

Re: encryption with python

2005-09-10 Thread Robert Kern
Kirk Job Sluder wrote: > Paul Rubin writes: > >>Kirk Job Sluder <[EMAIL PROTECTED]> writes: >>We're told there is already a secure database in the picture >>somewhere, or at least one that unescapeably contains cleartext SSN's, >>so that's the system that should assign t

Re: encryption with python

2005-09-10 Thread James Stroud
On Saturday 10 September 2005 14:01, Kirk Job Sluder wrote: > Providing any kind of access to data involves creating a security hole. > This is the biggest flaw in most discussions of computer security. On 9/9/05 Steven D'Aprano wrote: > There are "one-way" encryption functions where the result ca

Re: encryption with python

2005-09-10 Thread Paul Rubin
Kirk Job Sluder <[EMAIL PROTECTED]> writes: > I'm more than happy to agree to disagree on this, but I see it > differently. In aviation there certainly is a bit of risk-benefit > analysis going on in thinking about whether the cost of a given safety > is justified given the benefits in risk reduct

Re: encryption with python

2005-09-10 Thread Ron Adam
Kirk Job Sluder wrote: > The only way to keep confidential stuff secure is to shred it, burn it, > and grind the ashes. > > I think the fundamental problem is that that most customers don't want > actual security. They want to be able to get their information by > calling a phone number and sa

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Tom
Peter Hansen wrote: > Tom wrote: > >>Drive E: is removable, so I was careful to verify that that was a factor >>in the problem. >> >>Yes, I can do the same renaming, with the same drive, at the command line. >> >>I think I put the emphasis in the wrong place in my question. This >>isn't really

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

2005-09-10 Thread n00m
Bryan; My own version also timed out. And now I can tell: it's incredibly SLOW. Nevertheless it would be interesting to compare speed of my code against yours. I can't do it myself because my Python is of 2.3.4 version. Just uncomment "your" part. import bisect def oops(w,a,b): for m in w:

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Tim Daneliuk
Dennis Lee Bieber wrote: > On 10 Sep 2005 05:36:08 EDT, Tim Daneliuk <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >>On a more general note, for all the promises made over 3 decades about >>how OO was the answer to our problems, we have yet to see quantum > > >

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

2005-09-10 Thread Paul Rubin
Mark Dufour <[EMAIL PROTECTED]> writes: > 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? -- http://mail.python.org/mailman/listinfo/python-list

Re: encryption with python

2005-09-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > last_number_used = 12345 > usable_IDs = [] > > def make_studentID(): > global last_number_used > global usable_IDs > if not usable_IDs: > # generate another batch of IDs in random order > usable_IDs = range(last_number_u

Re: encryption with python

2005-09-10 Thread James Stroud
On Saturday 10 September 2005 15:02, Ron Adam wrote: > Kirk Job Sluder wrote: > 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 > acce

Re: encryption with python

2005-09-10 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > Yes and no. Yes, you are theoretically correct. No, I don't think > you have the OP's original needs in mind (though I am mostly > guessing here). The OP was obviously a TA who needed to assign > students a number so that they could "anonymously" check th

Re: encryption with python

2005-09-10 Thread James Stroud
On Saturday 10 September 2005 16:30, Paul Rubin wrote: > The info to be combined was the student's birthdate.  Why would the TA > have access to either that or the SSN? Speaking as a former TA, we had all that and a little more, if I remember correctly. The "why" aspect is a little beyond me. Ja

[pyparsing] make sure entire string was parsed

2005-09-10 Thread Steven Bethard
How do I make sure that my entire string was parsed when I call a pyparsing element's parseString method? Here's a dramatically simplified version of my problem: py> import pyparsing as pp py> match = pp.Word(pp.nums) py> def parse_num(s, loc, toks): ... n, = toks ... return int(n) + 10

Fun with decorators and unification dispatch

2005-09-10 Thread talin at acm dot org
Been playing around a bit more with developing my python inference engine, and I thought it might be of general interest (plus, I am finding the criticism useful). My original goal was to brush up on my math skills. Now, I've long felt that the best way to learn a language *thoroughly* is to write

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread François Pinard
[Tim Daneliuk] > OO ideas predate C++ considerably. The idea of encapsulation and > abstract data types goes back to the 1960s IIRC. Did not Simula-67 have it all already? When C++ came along, much later, I asked someone knowledgeable in the field of language design what was his opinion about C

Re: Fun with decorators and unification dispatch

2005-09-10 Thread Paul Rubin
"talin at acm dot org" <[EMAIL PROTECTED]> writes: > # Declare that "Factor" is a generic function > Factorial = Function() Was the comment a typo for Factorial? > # Define Factorial( 0 ) > @Arity( 0 ) > def Factorial(): > return 1 Overriding old definition of Factorial > # Define Factorial

Re: Python compiled?

2005-09-10 Thread Terry Reedy
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: >> Nor has 386 'machine language' suffered from being interpreted, at a >> deeper >> level, by microcode. > > I think both you and Paul may be missing Tim's point. I don't think he's > talking about "s

Expected Value

2005-09-10 Thread George
How would I get the expected value out of this information. I have tried many times to understand this but am unable to. The function expectP(z) computes E(X) for the random variable representing a sample over the probability generated by "pf" for the set of discrete items [1,10]. The consta

Re: Fun with decorators and unification dispatch

2005-09-10 Thread talin at acm dot org
Yes, it was a typo. Even thought the function has not yet been bound to the name "Factorial" when it calls the decorator, the function's __name__ attribute is set to it, so I use that to look up the name of the generic. Here''s the source for Arity: def Arity( *pattern ): """A function decor

Re: calling command line programs?

2005-09-10 Thread Grant Edwards
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 suggests to

Re: How to handle very large MIME Messages with the email package?

2005-09-10 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Looking at the email package, it seems all the MIMExxx classes takes > string but not file object as the payload. I need to handle very large > MIME messages say up to 100M. And possibly many of them. Is email > package sufficient. If

Re: encryption with python

2005-09-10 Thread Ron Adam
James Stroud wrote: > On Saturday 10 September 2005 15:02, Ron Adam wrote: > >>Kirk Job Sluder wrote: >>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

Re: Python versus Perl

2005-09-10 Thread Terry Reedy
"Roy Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dieter Vanderelst <[EMAIL PROTECTED]> wrote: >> 1 - How does the speed of execution of Perl compares to that of Python? > To a first-order approximation, Perl and Python run at the same speed. 'Speed of execution' is a fe

Re: Escaping certain characters

2005-09-10 Thread Kent Johnson
Jan Danielsson wrote: > Robert Kern wrote: > [---] > >>>Hmm... On second thought, I need to escape more characters. >>> >>>Is there no other way to escape characters in strings? >> >>Which characters? > > >I need to escape '\n', '"', '[' and ']'. I finally went with a few of > these: > strin

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

2005-09-10 Thread D H
Terry Reedy wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>The module will be public domain. > > > Various lawyers have suggested that either you cannot do that (is US) or > that you should not do that. (You know the joke -- ask two lawyers and you > get three opi

Re: make sure entire string was parsed

2005-09-10 Thread Paul McGuire
Steven - 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. I notice you call leaveWhitespace on several of your

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

2005-09-10 Thread Tim Peters
[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 money that the algorit

Re: encryption with python

2005-09-10 Thread Kirk Job Sluder
Paul Rubin writes: > Kirk Job Sluder <[EMAIL PROTECTED]> writes: > > Likewise, credit companies are currently making money hand-over-fist. > > If an identity is compromised, it's cheaper for them to just close the > > account, refund the money, and do their own fraud inv

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

2005-09-10 Thread adDoc's networker Phil
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;  but the primary mission of pypy is just having a python system that is written in something lik

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Peter Hansen
Tom wrote: > Peter Hansen wrote: >> Where do you think those double quotation marks came from? What >> happens if you try the following instead of using the variables you >> were trying to use? >> >> os.rename("e:\\music\\Joni Mitchell\\ogg-8", >> "e:\\music.ogg\\Joni Mitchell\\ogg-8") >> >

Re: encryption with python

2005-09-10 Thread Kirk Job Sluder
Ron Adam <[EMAIL PROTECTED]> writes: > Kirk Job Sluder wrote: > > > They want to be able to get their information by > > calling a phone number and saying a few words/phrases they memorized in > > childhood. Given the current market, it seems to be cheaper to deal > > with breaks after the fact

Re: Question about consistency in python language

2005-09-10 Thread Steve Holden
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 aware that >

getting words from readline

2005-09-10 Thread Adam
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 StringIO ? Any help

Re: re module help

2005-09-10 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I am trying to make prescript-2.2 (old python based psotscript to plain > text converter). > It gives the following dprecation message > > /local/users/ishwar/prescript-2.2/misc.py:23: DeprecationWarning: the > regex module is deprecated; please use the re module > imp

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Steve Holden
Bengt Richter wrote: > On Sat, 10 Sep 2005 16:55:51 +0200, "Martin P. Hellwig" <[EMAIL PROTECTED]> > wrote: > > >>Stefano Masini wrote: >> >> >>Although I'm not experienced enough to comment on python stuff itself I >>do know that in general there are 2 reasons that people reinvent the wheel:

Re: getting words from readline

2005-09-10 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-10 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 Pa

  1   2   >