Re: Python To Send Emails Via Outlook Express

2004-12-23 Thread ian
I wish I new why google doesn't show nicely aligned python code when you paste the script. Anyways, in case this helps someone else you can download the script from http://www.kirbyfooty.com/simplemapi.py Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python To Send Emails Via Outlook Express

2004-12-23 Thread ian
Hi Lenard, You just beat me to it. Suprise, suprise, I discovered the answer myself this time. I have modified the script to allow the attachment(s) to still be passed as a string. Some error checking is also done to verify the attachment file exists. I have also modified it so it can be used for

Re: regular expression: perl ==> python

2004-12-23 Thread Nick Craig-Wood
Fredrik Lundh <[EMAIL PROTECTED]> wrote: > the undocumented sre.Scanner provides a ready-made mechanism for this > kind of RE matching; see > > http://aspn.activestate.com/ASPN/Mail/Message/python-dev/1614344 > > for some discussion. > > here's (a slight variation of) the code example t

[PIL] is there a downloadable docs for PIL

2004-12-23 Thread Egor Bolonev
sometimes a have no internet access, but want to work :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python To Send Emails Via Outlook Express

2004-12-23 Thread Lenard Lindstrom
[EMAIL PROTECTED] writes: > Hello again, > Thanks for the advice! > Unfortunately I still cannot get it to send attachments. > It comes up with the following windows error.. > (I have a feeling it has something to do with the file count) > > >>> import simplemapi > >>> simplemapi.SendMail("[EMAIL

Re: Koolaid (was Re: Optional Static Typing)

2004-12-23 Thread Tim Churches
Peter Hansen <[EMAIL PROTECTED]> wrote: > > John Roth wrote: > > "Rocco Moretti" <[EMAIL PROTECTED]> wrote: > >> The question is, should Guido state "TDD is the one true way to > >> program in Python.", or should concessions be made in the language > >> design for those who don't "drink the TDD

Re: Global variables and modules

2004-12-23 Thread Binu K S
Add these lines to test1.py and see what you get: import test2 print 'test2.glbl postinc ', test2.glbl This will work as you expect. Next try chaning glbl in test2 to a list (a mutable type). test2.py: glbl = [25] def inc_glbl(): global glbl glbl[0] = glbl[0] + 1 def get_glb

Re: String backslash characters

2004-12-23 Thread Dan Bishop
PD wrote: > Hello, > > I am new to python, but i am quite curious about the following. > > suppose you had > > print '\378' > > which should not work because \377 is the max. then it displays two > characters (an 8 and a heart in my case...). What else does'nt quite > make sense is that if this is

Global variables and modules

2004-12-23 Thread dkeeney
I have a newby type question on how global variables work between modules. I have a module test2.py that defines a global variable as well as two functions to operate on that variable. A script test1.py imports the three names and prints out values of the global between operations, and the resul

Re: String backslash characters

2004-12-23 Thread Benji York
PD wrote: I am new to python, but i am quite curious about the following. print '\378' which should not work because \377 is the max. then it displays two characters (an 8 and a heart in my case...). What else does'nt quite make sense is that if this is an octal why is an 8 accepted? It would appea

Re: String backslash characters

2004-12-23 Thread Binu K S
'\378' becomes a two character string. The first character is '\37' and the second character is '8'. >>> str = '\378' >>> str[0] '\x1f' >>> str[1] '8' >>> On 23 Dec 2004 20:53:13 -0800, PD <[EMAIL PROTECTED]> wrote: > Hello, > > I am new to python, but i am quite curious about the following. >

String backslash characters

2004-12-23 Thread PD
Hello, I am new to python, but i am quite curious about the following. suppose you had print '\378' which should not work because \377 is the max. then it displays two characters (an 8 and a heart in my case...). What else does'nt quite make sense is that if this is an octal why is an 8 accepte

Re: Windows XP - cron or scheduler for Python?

2004-12-23 Thread ian
Hi, I thought I'd throw in my 2 cents worth. I have written a freeware task scheduler that might be of interest to you. It's called Kirby Alarm And Task Scheduler. Over 16000 people around the world use it. Kirby Alarm will run a program, pop up a note, play a sound, or send an email at whatever

Re: Best GUI for small-scale accounting app?

2004-12-23 Thread Al Christians
Web browser "widgets" seem pretty limited to me, though. You don't even have something as simple as a combo box (i.e. an editable entry with a drop down), let alone the rich set of widgets something like wxwidgets offers. Also web development doesn't seem as coherent to me as development with a

converting octal strings to unicode

2004-12-23 Thread flamingivanova
I have several ascii files that contain '\ooo' strings which represent the octal value for a character. I want to convert these files to unicode, and I came up with the following script. But it seems to me that there must be a much simpler way to do it. Could someone more experienced suggest some i

RE: Lambda going out of fashion

2004-12-23 Thread Robert Brewer
Stephen Thorne wrote: > Lambdas contain only a single expression. Even the py3k > wiki page ignores this critical difference. A single expression > means no statements of any kind can be included. Assignment, > if/elif/else, while, for, try/except, etc are not catered > for in lambdas. That's been

RE: Lambda going out of fashion

2004-12-23 Thread Robert Brewer
Nick Coghlan wrote: > ...rather than pushing to retain lambda for Py3K, it might > be more productive to find a better statement -> expression > translation for function definitions. Guido seems to prefer > named functions, so it would still be tough to gain his > acceptance. However, a more Python

Re: Guido & Optional Static Typing

2004-12-23 Thread Luis M. Gonzalez
Sorry... I just realized that somebody else already had started a thread on this... -- http://mail.python.org/mailman/listinfo/python-list

Guido & Optional Static Typing

2004-12-23 Thread Luis M. Gonzalez
Hi folks, This is an interesting new article (published today Dec. 23). Guido discusses the possibility of adding optional static typing to Python: http://www.artima.com/weblogs/viewpost.jsp?thread=85551 -- http://mail.python.org/mailman/listinfo/python-list

Python and Delphi

2004-12-23 Thread Kristofer Carlson
I'm curious about the long term trends chart on the TIOBE Programming Community Index chart at http://www.tiobe.com/tpci.htm. It shows the prevalence of Delphi and Python have tracked roughly equivalent usage paths for some years now. Does anyone know why, or is this just an interesting but i

Re: Python To Send Emails Via Outlook Express

2004-12-23 Thread ian
Hello again, Thanks for the advice! Unfortunately I still cannot get it to send attachments. It comes up with the following windows error.. (I have a feeling it has something to do with the file count) >>> import simplemapi >>> simplemapi.SendMail("[EMAIL PROTECTED]","The Subject","The body","c:\i

Re: Creating Image Maps

2004-12-23 Thread M.E.Farmer
Hello Aaron, You need to check the demo that comes with wxPython if you don't have it get it. Look under wxHtmlWindow and click the demo tab then just scroll down and there is a link to it that says IMAGEMAP. Or in other words RTFD ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-

Re: PHP vs. Python

2004-12-23 Thread Roger Binns
"Stephen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I like the idea of being able to port specific sections to C ... Python > seems more flexible than PHP ... scalable. If you want portions of your code in C, then wrap them with Swig. That way they can be available in any numbe

Re: sql server support from linux

2004-12-23 Thread Simon Wittber
> I considered doing exactly the same thing a while ago, but was worried > about running into an annoyance like that. FWIW, The synchronous Pyro server performed much faster than the multithreaded version, even under heavy use from 3 machines. It appeared that while the database queries were se

Creating Image Maps

2004-12-23 Thread Aaron
I know this is a thing used primarily on websites..but since python can do anything ;) I'm trying to make a clickable image map for my wxPython program. Basically, I know how to organize the images into one large image in a panel, but how do I make the individual pieces clickable like webpage link

Re: How about "pure virtual methods"?

2004-12-23 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > Noam Raphael <[EMAIL PROTECTED]> writes: > > > The answer is that a subclass is guaranteed to have the same > > *interface* as the base class. And that's what matters. > > This is false. For instance: > > class A(object): > def method(self, a): > pri

Re: How about "pure virtual methods"?

2004-12-23 Thread Alex Martelli
Noam Raphael <[EMAIL PROTECTED]> wrote: > However, I'm not sure if this solves my practical problem - testing > whether all abstract methods were implemented. I think that usually, you > can't write a test which checks whether an abstract method did what it > should have, since different implemen

Re: Best GUI for small-scale accounting app?

2004-12-23 Thread Paul Rubin
Dave Cook <[EMAIL PROTECTED]> writes: > > You might not care. > > And in that case Tk is much simpler than just about anything else, unless > looks are really important. I've used tk and I don't think it's simpler than html. > Takes up twice as much space and is potentially confusing as the drop

Re: How about "pure virtual methods"?

2004-12-23 Thread Noam Raphael
Mike Meyer wrote: Noam Raphael <[EMAIL PROTECTED]> writes: The answer is that a subclass is guaranteed to have the same *interface* as the base class. And that's what matters. This is false. For instance: class A(object): def method(self, a): print a class B(A): def method(self, a, b): p

Re: Lambda going out of fashion

2004-12-23 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well, you can say apply() is 'deprecated' now, What is deprecated is the spelling, not the concept or functionality. As far as I know, apply(func, args) is exactly equivalent to func(*args). If the latter had been invented in the begi

Re: list Integer indexing dies??

2004-12-23 Thread Stephen Thorne
On Fri, 24 Dec 2004 02:59:40 +1030, Ishwor <[EMAIL PROTECTED]> wrote: > >>> 123[0] + 2 > 3 TypeError: unsubscriptable object > > > in which basically python can infer from the object type and print out > > > 1 instead of coughing up those errors? > > > > Why do you feel it should cough up 1? > >

Re: How about "pure virtual methods"?

2004-12-23 Thread Noam Raphael
Jp Calderone wrote: This lets you avoid duplicate test code as well as easily test new concrete implementations. It's an ideal approach for frameworks which mandate application-level implementations of a particular interface and want to ease the application developer's task. Jp It's a great

Re: PHP vs. Python

2004-12-23 Thread Stephen
I like the idea of being able to port specific sections to C ... Python seems more flexible than PHP ... scalable. We're mainly using it to drive dynamic web apps ... online store ... etc. Thanks Again! Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib and sites that require passwds

2004-12-23 Thread Fuzzyman
Ishwor wrote: > On 23 Dec 2004 06:46:50 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote: > > damn... I'm losing my leading spaces indentation should be obvious > We'll forgive you for that. It was from "top-of-your-head" ~;-) > Hey - I put the indentation in there... it just got stripped out when i

Re: Keyword arguments - strange behaviour?

2004-12-23 Thread Fuzzyman
Steven Bethard wrote: > Fuzzyman wrote: > >>>Steven Bethard wrote: > > So, one of my really common use cases that takes advantage of the > fact that default parameters are evaluated at function definition > time: > > def foo(bar, baz, matcher=re.compile(r'...')): >

Re: odbc script

2004-12-23 Thread Benji York
Steve Holden wrote: you might want to look at www.egenix.com and think about installing the mxODBC module, which I have used with very good results. I'd also recommend checking out the imaginatively named adodbapi (http://adodbapi.sourceforge.net/) which allows you to use any ODBC driver through

RE: Metaclasses

2004-12-23 Thread Robert Brewer
Bob Cowdery wrote: > Thanks for your help Robert. I'm still not > understanding what I am seeing. I've forgotten > about the objective for the moment. I just want > to understand metaclasses. All right; then I'll skip the speech about how metaclasses are not the solution you're looking for. ;) Th

Re: sql server support from linux

2004-12-23 Thread Benji York
Simon Wittber wrote: If you can get the DB-API wrappers running on Win2k, how about doing that locally and then writing a quickie socket server which your linux client can connect to? I've exposed the DB API using Pyro. I had to turn multithreading off, as the server leaked memory on every query.

Re: Best GUI for small-scale accounting app?

2004-12-23 Thread Dave Cook
On 2004-12-21, Paul Rubin wrote: > Dave Cook <[EMAIL PROTECTED]> writes: >> Web browser "widgets" seem pretty limited to me, though. > > You might not care. And in that case Tk is much simpler than just about anything else, unless looks are really important. >> You don't even have something as

Re: odbc for solid

2004-12-23 Thread Benji York
flupke wrote: On winsdows i could get by by using ODBC and the dll's to access the solid database but i want to eventually run it on a linux server. ODBTP (http://odbtp.sourceforge.net/) allows you to hit Windows ODBC drivers over the network from any machine with a C compiler. If it sounds lik

Koolaid (was Re: Optional Static Typing)

2004-12-23 Thread Peter Hansen
John Roth wrote: "Rocco Moretti" <[EMAIL PROTECTED]> wrote: The question is, should Guido state "TDD is the one true way to program in Python.", or should concessions be made in the language design for those who don't "drink the TDD Kool-aide". Neither one. I hope you didn't mean that people who

PyCon Registration Opens Today!

2004-12-23 Thread Steve Holden
Dear Python User: Following my last message, I am pleased to be able to announce that you can register for PyCon DC 2005 on the web at http://www.python.org/pycon/2005/register.html starting at 1700 EST today (December 23). Thanks to George Belotsky of Open Light Software for assistance in

Re: list Integer indexing dies??

2004-12-23 Thread Dan Bishop
Jeff Shannon wrote: > Ishwor wrote: > > >On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo > ><[EMAIL PROTECTED]> wrote: > > > > > >>[Ishwor] > >> > >>#- > What should 035[0] cough up? Be carefull it should > >>#- > >>#- >>>035[0] > >>#- 3 # my own opinion. > >> > >> > >why 3? The reason we get

Re: Python Interactive Shell - outputting to stdout?

2004-12-23 Thread Avi Berkovich
Hey Steve, I did write a program to deal with the windows command interpreter, and it works. I don't need to do this, but a friend of mine needed to issue commands to the interpreter via pipes from a non python program, and he has a fully functional component for using pipes, and has done it wi

Re: Lambda going out of fashion

2004-12-23 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Thanks. :-) Two remarks. > o One-liner fits the eyes & brains of a portion of people. True! So, personally, I'd rather code, e.g., def bools(lst): return map(bool, lst) rather than breal this one-liner into two lines at the colon, as per standard Python style. How

Re: Python To Send Emails Via Outlook Express

2004-12-23 Thread Lenard Lindstrom
[EMAIL PROTECTED] writes: > Hi Lenard, > > As the risk of severely embarassing myself can I ask for your help one > more time. > I have tried changing your script to include attachments, but guess > what, (and this should come as no suprise) I can't do it. > So > Here is my feeble attempt at

Re: Lambda going out of fashion

2004-12-23 Thread rzed
Jp Calderone <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Thu, 23 Dec 2004 13:36:08 GMT, rzed <[EMAIL PROTECTED]> wrote: >>Stephen Thorne <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> > [snip] >> > >> > { >> > 'one': lambda x:x.blat(), >> > 'two': lambda x:x.blah(),

Re: Lambda going out of fashion

2004-12-23 Thread Kent Johnson
Robin Becker wrote: Alex Martelli wrote: . By the way, if that's very important to you, you might enjoy Mozart (http://www.mozart-oz.org/) .very interesting, but it wants to make me install emacs. :( Apparently you can also use oz with a compiler and runtime engine...see http://www.mozart-o

Re: BASIC vs Python

2004-12-23 Thread Tim Jarman
In article <[EMAIL PROTECTED]>, Alan Gauld <[EMAIL PROTECTED]> wrote: > I dunno. Here in the UK there was a small home computer called (I > think) the Oric(*) which had a membrane keyboard, 4K or RAM and > ran Forth.It had a small cult following before dying out. It > looked a bit like the early

Re: Python Interactive Shell - outputting to stdout?

2004-12-23 Thread Steve Holden
Avi Berkovich wrote: Hello, I was unable to use popen2.popen4 to grab python.exe's (2.3) output, for starts, it doesn't show the version information at the beginning and won't return anything when writing to the stdin pipe, it seems that if I give it some error nous expression, the pipe would re

Re: Reading and Writing

2004-12-23 Thread Novitiate
-Galahad, Thank you very much. I will give it a shot and see if I can make it hapen. I think this will help a lot. I was just trying to implement a simple sorting algorithm that I knew from C++, for practice but I couldn't figure the mechanics of Python. Thanks again, Novitiate -- http://mai

Re: list Integer indexing dies??

2004-12-23 Thread Jeff Shannon
Ishwor wrote: On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo <[EMAIL PROTECTED]> wrote: [Ishwor] #- > What should 035[0] cough up? Be carefull it should #- #- >>>035[0] #- 3 # my own opinion. why 3? The reason we get 3 and not 0 here is the *fact* that Python knows that its an o

Re: list Integer indexing dies??

2004-12-23 Thread Serhiy Storchaka1745620946
Ishwor wrote: On Thu, 23 Dec 2004 11:17:57 -0300, Batista, Facundo Well, because the integer is not a subscriptable object If i see this code 'a'[0] then what does it really say about semantics ?? Really its hard for me to digest that 'a'[0] is supported by Python where as 1[0] isn't. 5.2/3 is

Re: Lambda going out of fashion

2004-12-23 Thread Fernando Perez
Alex Martelli wrote: > I don't know what it IS about lambda that prompts so much dubious to > absurd use, but that's what I observed. I don't know if that plays any > role in Guido's current thinking, though -- I have no idea how much > "dubious Python" he's had to struggle with. Just a side com

Re: Reading and Writing

2004-12-23 Thread Novitiate
-Galahad, Thank you very much. I will give it a shot and see if I can make it hapen. I think this will help a lot. I was just trying to implement a simple sorting algorithm that I knew from C++, for practice but I couldn't figure the mechanics of Python. Thanks again, Novitiate -- http://mai

Python Interactive Shell - outputting to stdout?

2004-12-23 Thread Avi Berkovich
Hello, I was unable to use popen2.popen4 to grab python.exe's (2.3) output, for starts, it doesn't show the version information at the beginning and won't return anything when writing to the stdin pipe, it seems that if I give it some error nous expression, the pipe would return the exception d

Re: Switch statement (was: Lambda going out of fashion)

2004-12-23 Thread rzed
Skip Montanaro <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Stephen> { > Stephen> 'one': lambda x:x.blat(), > Stephen> 'two': lambda x:x.blah(), > Stephen> }.get(someValue, lambda x:0)(someOtherValue) > > One thing to remember is that function calls in Python are >

Anyone have a python socket.pyd that support raw socket for windows?

2004-12-23 Thread Simon Roses Femerling
Hi all,   I got python 2.3 on a XP and win2k. I'm looking for a _socket.pyd that support raw socket (IP_HDRINCL). I did found someone guy that did compile his own _socket (pysockraw) but the web is not working anymore :/   I'm lazy to compile my own :)   Thx, and Merry X-mas!!   Simon Roses Fe

Re: Optional Static Typing

2004-12-23 Thread Rocco Moretti
John Roth wrote: "Rocco Moretti" <[EMAIL PROTECTED]> wrote > Looking at C, it's doubtful error prevention and program clarification was a serious objective in the static typing system. It's more reasonable to conclude that C is statically typed because it allows the compiler to more easily allo

Re: error problems for import some copora with nltk

2004-12-23 Thread [EMAIL PROTECTED]
Dear Jeff, Thank you, it was the numeric. After I installed the numeric library which is Numeric-23.6.win32-py2.3.exe for python 2.3.4 verson, it is working correctly. Thank you again, Kyung -- http://mail.python.org/mailman/listinfo/python-list

hidding the "console" window + system global shortcut keys

2004-12-23 Thread Gabriel Cosentino de Barros
Title: hidding the "console" window + system global shortcut keys Hi, it's a broad topic because they all poped in my head at the same time while writting the alpha version of a desktop-helper app. The app must be the less obstrusive possible. some history: It's mainly for win32. I started wr

Re: Windows XP - cron or scheduler for Python?

2004-12-23 Thread Emilio
I have gone through the pain of trying to use those commands and use other available cron clients for Windows to find they are expensive, or have bugs and are not stable. So I wrote a very simple yet powerful script that handles all the basic functionality of Cron. It has been stable and used in pr

Re: Windows XP - cron or scheduler for Python?

2004-12-23 Thread Emilio
Cron clients for Windows to find they are expensive, or have bugs and are not stable. So I wrote a very simple yet powerful script that handles all the basic functionality of Cron. It has been stable and used in production for about a year. The source code is in Python and you can read it, it is a

Re: Lambda going out of fashion

2004-12-23 Thread Skip Montanaro
Jp> PyStones may be short (and be nearly lambda free!) but it is one Jp> opaque blob to me. I'd be hard pressed to rewrite it in any style, Jp> given its perverse use of global state. It's written that way on purpose, of course. Pystone is almost a direct translation of a similar pr

Re: Optional Static Typing

2004-12-23 Thread John Roth
"Rocco Moretti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] John Roth wrote: One of the comments on Artima asks a rather profound question: static typing is an answer. What's the question? (That's a paraphrase.) The answer that everyone seems to give is that it prevents errors and

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
On Thu, 23 Dec 2004 12:00:29 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: > > >> While I'm sure it can be done, I'd hate to see a non-trivial Python > >> program written with lambda instead of def. > > Jp> What, like this? > > Jp> (lambda r,p,b:... > > Jp> OTOH, maybe

Re: Optional Static Typing

2004-12-23 Thread bearophileHUGS
Doug Holton: >And there are some disadvantages to doing it this way. >It means Python is more flexible to use than Boo, I've just suggested the *syntax* that I like more. Bye, Bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with msvcrt60 vs. msvcr71 vs. strdup/free

2004-12-23 Thread "Martin v. Löwis"
Scott David Daniels wrote: I encourage anyone who gets further into solving the "How do I use MinGW to build Python2.4 (and later) standard-distribution compatible modules (.pyd s)?" question to share any clues they have. The MS free compiler is useful to many, but not all of us. I think the simpl

Re: Problem with ./configure (py2.3.4)

2004-12-23 Thread "Martin v. Löwis"
André Amram Duque wrote: I have problem with re-install python 2.3.4, when I execute ./configure is appear one message in config.log, follow below : configure:1710: gccconftest.cc >&5 gcc: installation problem, cannot exec `cc1plus': No such file or directory configure:1713: $? = 1 My gnu/li

ADO, Python and MS Exchange

2004-12-23 Thread warren ali
Hi all! I'm new to python and I seem to have a hit a of a brick wall. I hope you guys can help. I'm trying to rewrite some of my vbscripts in python. This particular script connects to a mailbox in MS Exchange via ADO and calculates the mailbox size. I seem to have run into a couple of issues get

Re: Unicode entries on sys.path

2004-12-23 Thread "Martin v. Löwis"
Thomas Heller wrote: It seems that Python itself converts unicode entries in sys.path to normal strings using windows default conversion rules - is this a problem that I can fix by changing some regional setting on my machine? You can set the system code page on the third tab on the XP regional set

Re: list Integer indexing dies??

2004-12-23 Thread Lonnie Princehouse
> ;-) gotcha. But shouldn't this be valid too?? > >>> 123232[0] No, it shouldn't be valid. It makes the implicit assumption that you want the base 10 digit, which isn't really a good assumption to make in the world of computers. Programmers are just as likely to want hexadecimal, and arguments c

Re: list IndexError

2004-12-23 Thread Jeff Shannon
Grant Edwards wrote: On 2004-12-23, Steven Bethard <[EMAIL PROTECTED]> wrote: Ah, my mistake, I missed the [:] after the source argument that was taking a copy... which brings up the question, how many other people would miss it? Too many. This is why I greatly prefer list(lst) T

Re: Lambda going out of fashion

2004-12-23 Thread Fredrik Lundh
Skip Montanaro wrote: >Jp> OTOH, maybe that's still trivial, it's only a multiuser network >Jp> chat server, after all. > > You cheated by not rewriting Twisted using only lambda. isn't twisted already written with lambdas only? why else would they call it "twisted"? -- http:

Re: Lambda going out of fashion

2004-12-23 Thread Fredrik Lundh
"jfj" wrote: > Personally I'm not a fan of functional programming but lambda *is* useful > when I want to say for > example: > > f (callback=lambda x, y: foo (y,x)) > > I don't believe it will ever disappear. agreed. there's no reason to spend this christmas rewriting your programs, folks.

Re: Lambda going out of fashion

2004-12-23 Thread Skip Montanaro
>> While I'm sure it can be done, I'd hate to see a non-trivial Python >> program written with lambda instead of def. Jp> What, like this? Jp> (lambda r,p,b:... Jp> OTOH, maybe that's still trivial, it's only a multiuser network Jp> chat server, after all. You che

Re: Lambda going out of fashion

2004-12-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > o Why don't you just say all python can be written in equivalent java, your argumentation skills are awesome. -- http://mail.python.org/mailman/listinfo/python-list

Re: error problems for import some copora with nltk

2004-12-23 Thread Jeff Shannon
[EMAIL PROTECTED] wrote: Hi, According to your advice, I installed the numeric library which is numarray-1.1.1.win32-py2.4.exe, but I got the error message as follows. Any help? frustrated... from nltk.corpus import gutenberg

Re: Optional Static Typing

2004-12-23 Thread Rocco Moretti
John Roth wrote: One of the comments on Artima asks a rather profound question: static typing is an answer. What's the question? (That's a paraphrase.) The answer that everyone seems to give is that it prevents errors and clarifies the program. It might just be me, but I thought it was to simpl

Re: Lambda going out of fashion

2004-12-23 Thread tanghaibao
Thanks. :-) Two remarks. o One-liner fits the eyes & brains of a portion of people. o Why don't you just say all python can be written in equivalent java, can I assert that Guido doesn't want to get mixed with those mainstream>? -- http://mail.python.org/mailman/listinfo/python-list

RE: extract news article from web

2004-12-23 Thread Gabriel Cosentino de Barros
Title: RE: extract news article from web Excel in later offices has the "web query" feature. (sorry about top posting) -Original Message- From: Steve Holden [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 23 de dezembro de 2004 12:59 To: python-list@python.org Subject: Re: extract n

Re: Lambda going out of fashion

2004-12-23 Thread Steven Bethard
[EMAIL PROTECTED] wrote: I have this book called TEXT PROCESSING IN PYTHON by David Mertz on hand, it is a good book and in the first chapter it is really a show room for higher-order functions which I may now cite to remind you of the FLEXIBILITY of this keyword. I'm not exactly sure what you mean

Re: PHP vs. Python

2004-12-23 Thread Roger Binns
"Eric Pederson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > My beloved Python-oriented webhost doesn't currently support Mod-Python You can always do what I did. I wrote the backend of my app in Python and run it as an XML-RPC server. I did the front end in PHP using the Smart

Problem with ./configure (py2.3.4)

2004-12-23 Thread André Amram Duque
I have problem with re-install python 2.3.4, when I execute ./configure is appear one message in config.log, follow below : configure:1710: gccconftest.cc >&5 gcc: installation problem, cannot exec `cc1plus': No such file or directory configure:1713: $? = 1 My gnu/linux is 2.6.8-1-386(debian

Re: Optional Static Typing

2004-12-23 Thread John Roth
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Adding Optional Static Typing to Python looks like a quite complex thing, but useful too: http://www.artima.com/weblogs/viewpost.jsp?thread=85551 One of the comments on Artima asks a rather profound question: static typing is an answer. W

copying builtin types (WAS: list IndexError)

2004-12-23 Thread Steven Bethard
Grant Edwards wrote: I would have guessed that calling list() on a list was a noop. I would be wrong. Surprised, but wrong. I guess it's probably worth pointing out that most builtin mutable types can be copied using the type constructor: py> def check(obj): ... copy = type(obj)(obj) ...

Re: Lambda going out of fashion

2004-12-23 Thread tanghaibao
I have this book called TEXT PROCESSING IN PYTHON by David Mertz on hand, it is a good book and in the first chapter it is really a show room for higher-order functions which I may now cite to remind you of the FLEXIBILITY of this keyword. ''' combinatorial.py from operator import mul, add, truth

Re: list Integer indexing dies??

2004-12-23 Thread Steven Bethard
Ishwor wrote: On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo <[EMAIL PROTECTED]> wrote: [Ishwor] #- > What should 035[0] cough up? Be carefull it should #- #- >>>035[0] #- 3 # my own opinion. #- #- > cough up the same as 29[0]. #- #- >>>29[0] #- 2 #again my own opinion Be aware th

Re: list IndexError

2004-12-23 Thread Ishwor
On Thu, 23 Dec 2004 13:57:55 -0300, Batista, Facundo <[EMAIL PROTECTED]> wrote: > > > [Steven Bethard] > > #- True, true. Maybe you could lobby for copy as a builtin in > #- Python 3000? > > That's a good idea to me. But copy() as a builtin is not clear if it's > shallow or deep. IMHO its

RE: list IndexError

2004-12-23 Thread Batista, Facundo
Title: RE: list IndexError [Steven Bethard] #- True, true.  Maybe you could lobby for copy as a builtin in #- Python 3000? That's a good idea to me. But copy() as a builtin is not clear if it's shallow or deep. .   Facundo . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Re: Lambda going out of fashion

2004-12-23 Thread Steven Bethard
Jp Calderone wrote: On Thu, 23 Dec 2004 10:19:33 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: While I'm sure it can be done, I'd hate to see a non-trivial Python program written with lambda instead of def. What, like this? [snip horrible lambda expression] OTOH, maybe that's still trivial,

Re: list IndexError

2004-12-23 Thread Steven Bethard
Grant Edwards wrote: Wouldn't the clearest way to get a copy would be to do something like: copy(lst) # I still think copy.copy() is a bit verbose... True, true. Maybe you could lobby for copy as a builtin in Python 3000? Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: list IndexError

2004-12-23 Thread Grant Edwards
On 2004-12-23, Steven Bethard <[EMAIL PROTECTED]> wrote: >> Ah, my mistake, I missed the [:] after the source argument >> that was taking a copy... which brings up the question, how >> many other people would miss it? > > Too many. This is why I greatly prefer > > list(lst) To me, that's jus

Re: list Integer indexing dies??

2004-12-23 Thread Ishwor
On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo <[EMAIL PROTECTED]> wrote: > > > [Ishwor] > > #- > What should 035[0] cough up? Be carefull it should > #- > #- >>>035[0] > #- 3 # my own opinion. why 3? The reason we get 3 and not 0 here is the *fact* that Python knows that its an octal

Re: list Integer indexing dies??

2004-12-23 Thread Ishwor
On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo <[EMAIL PROTECTED]> wrote: > > > [Ishwor] > > #- > What should 035[0] cough up? Be carefull it should > #- > #- >>>035[0] > #- 3 # my own opinion. > #- > #- > cough up the same as 29[0]. > #- > #- >>>29[0] > #- 2 #again my own opinion

RE: list Integer indexing dies??

2004-12-23 Thread Batista, Facundo
Title: RE: list Integer indexing dies?? [Ishwor] #- > What should 035[0] cough up? Be carefull it should #- #- >>>035[0] #- 3 # my own opinion. #- #- > cough up the same as 29[0]. #- #- >>>29[0] #- 2 #again my own opinion Be aware that: >>> 035 == 29 True >>> .   Facundo

Re: Improving Python (was: Lambda going out of fashion)

2004-12-23 Thread Fredrik Lundh
Skip Montanaro wrote: > >Keith> My personal gripe is this. I think the core language, as of 2.3 >Keith> or 2.4 is very good, has more features than most people will ever >Keith> use, and they (Guido, et al.) can stop tinkering with it now and >Keith> concentrate more on the standard

Re: test

2004-12-23 Thread Tim Peters
[Per Erik Stendahl <[EMAIL PROTECTED]>] > sdfdsafasd Generally speaking, yes, but not if you're concerned about Pythons before 1.5.2 too. If you are, a reasonable workaround is: try: sdfdsafasd except NameError: pass else: True = None is None and 1 != 2 False = None is not None o

Re: Lambda going out of fashion

2004-12-23 Thread Jp Calderone
On Thu, 23 Dec 2004 10:19:33 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: > > >> readability. Pythonic lambdas are just syntactic sugar in practice, > > Paul> Actually it's the other way around: it's named functions that are > Paul> the syntactic sugar. > > While I'm sure it can b

Re: Keyword arguments - strange behaviour?

2004-12-23 Thread Steven Bethard
Fuzzyman wrote: Steven Bethard wrote: So, one of my really common use cases that takes advantage of the fact that default parameters are evaluated at function definition time: def foo(bar, baz, matcher=re.compile(r'...')): ... text = matcher.sub(r'...', text) ... Sure.. but you also gave a

  1   2   3   >