Re: Web forum (made by python)

2004-12-20 Thread Doug Holton
Fredrik Lundh wrote: ask yourself if that thing you read really was a vicious attack by bunch of nasty trolls, or if, perhaps, you missed the point. You still do not even acknowledge your behavior then? If it is your wish that I never mention boo again, then I will not, even though you and not

Re: expression form of one-to-many dict?

2004-12-20 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > On Sun, 19 Dec 2004 21:29:27 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > (or maybe a restricted unquote_arg function for better safety). > E.g., double back-tick is a syntax error now, so you could write > > def ternary(c, ``t, ``f): >

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Doug Holton
Istvan Albert wrote: Doug Holton wrote: the syntax of boo is indeed virtually identical to python. All that boo does is borrows a few syntactical constructs from python. Calling it virtually identical is *very* misleading. The syntax is indeed virtually identical to python. You are yet another

Re: Suggestion for "syntax error": ++i, --i

2004-12-20 Thread Doug Holton
Petr Prikryl wrote: Hi, Summary: In my opinion, the C-like prefix increment and decrement operators (++i and --i) should be marked as "syntax error". Let me rephrase my answer. This is a good sugestion for Python 3.0, a.k.a. Python 3000: http://www.python.org/cgi-bin/moinmoin/Python3.0 In the fut

Re: newbie question

2004-12-20 Thread Doug Holton
David Wurmfeld wrote: I am new to python; any insight on the following would be appreciated, even if it is the admonition to RTFM (as long as you can direct me to a relevant FM) Is there a standard approach to enumerated types? I could create a dictionary with a linear set of keys, but isn't t

Re: How about "pure virtual methods"?

2004-12-20 Thread Doug Holton
Doug Holton wrote: Noam Raphael wrote: even in the best solution that I know of, there's now way to check if a subclass has implemented all the required methods without running it and testing if it works. I think there are some solutions like PyProtocols, see section 2.2 on this page: http://ww

Re: atmosphere on c.l.py (WAS: How about "pure virtual methods"?)

2004-12-20 Thread Doug Holton
Doug Holton wrote: Steven Bethard wrote: I don't really have a good solution; despite the unnecessarily vicious comments, I don't feel like I can set my newsreader to ignore messages from, for example, Fredrik, because his answers, when not attacks, are often very insightful. If you find a good

Re: No acceptable C compiler was found in $PATH

2004-12-20 Thread William Allison
On Mon, 20 Dec 2004 03:58:20 +, banaticus wrote: > > What does this error message mean? What can I do to fix it? > > Here'e the command that I just tried running, and the messages that > I received. I just barely unpacked python. > > linux:/Python-2.4 # ./configure > checking MACHDE

Re: how to pass globals across modules (wxPython)

2004-12-20 Thread Hans Nowak
Martin Drautzburg wrote: My wxPython program starts execution in mainFrame.py like this [...] class MainApp(wxApp): def OnInit(self): self.mainFrame = MainFrame(None) self.mainFrame.Show() self.S

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Hans Nowak
Doug Holton wrote: Istvan Albert wrote: Doug Holton wrote: the syntax of boo is indeed virtually identical to python. All that boo does is borrows a few syntactical constructs from python. Calling it virtually identical is *very* misleading. The syntax is indeed virtually identical to python.

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Doug Holton
Hans Nowak wrote: Regardless of the merits of Boo, this is comp.lang.python, not comp.lang.boo. The language may *look* like Python, but its inner workings are nothing like Python, as several people have correctly pointed out now. (Just like Java's syntax may look like C or C++ in some areas,

Re: Easy "here documents" ??

2004-12-20 Thread Doug Holton
Jim Hill wrote: Is there a way to produce a very long multiline string of output with variables' values inserted without having to resort to this wacky """v = %s"""%(variable) No, it is currently not possible in Python without the hacks you have seen already. Python is long overdue for simpler st

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Luis M. Gonzalez
I agree with you, and I don't understand why so many people insist in "banning" the word "Boo" in this list. What's the problem guys? Is this a taboo or something? Isn't this list open for discussion of all things related to Python? Isn't Boo related to Python? And if you think it is not "related e

Re: Best GUI for small-scale accounting app?

2004-12-20 Thread tfillmor
Personally I think the priority of all new project developmnent should be based principally on web technologies, with OS-specific (i.e., desktop) versions only if there is absolutely no other way. You should really try CherryPy (http://www.cherrypy.org) - for Python-based web development I don't t

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Brian van den Broek
Doug Holton said unto the world upon 2004-12-20 18:45: Peter Hansen wrote: Doug Holton wrote: Peter Hansen wrote: "Virtually identical" indeed. :-) I gave such a short answer because the way you framed your "questions" and the context of your post made it clear you are a troll. Your reply here

Re: dot products

2004-12-20 Thread Raymond Hettinger
[Rahul]. > > I want to compute dot product of two vectors stored as lists a and b.a > > and b are of the same length. > > > > one simple way is > > sum(a[i]*b[i] for i in range(len(a))) > > > > another simple way is > > ans=0.0 > > for i in range(len(a)): > > ans=ans+a[i]*b[i] > > > > But is there

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Michael Hoffman
Doug Holton wrote: Istvan Albert wrote: All that boo does is borrows a few syntactical constructs from python. Calling it virtually identical is *very* misleading. The syntax is indeed virtually identical to python. You are yet another person who has trolled before. See your obvious trolling rep

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Mike Meyer
Michael Hoffman <[EMAIL PROTECTED]> writes: > Doug Holton wrote: >> Istvan Albert wrote: >>> All that boo does is borrows a few syntactical constructs >>> from python. Calling it virtually identical >>> is *very* misleading. >> The syntax is indeed virtually identical to python. You are yet >> ano

Re: dot products

2004-12-20 Thread Alan G Isaac
[Rahul]. > I want to compute dot product of two vectors stored as lists a and b.a > and b are of the same length from scipy import dot ans=dot(a,b) This times faster than the alternatives I have seen mentioned so far, given scipy. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Tim Peters
[Doug Holton] ... > But I will not be intimidated by the likes of Fredrik Lundh. Trollers > will be held accountable. Doug, Doug, Doug. Fredrik isn't a troll. He's a Swede. Trolls are Norwegian. Lighten up, please. Fredrik is usually terse, and sometimes curt (although Americans seem to have

Re: dot products

2004-12-20 Thread Alan G Isaac
"Alan G Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This times faster than the alternatives I have seen mentioned so far, > given scipy. Actually, since I am new to 'timeit', I probably should check that I am not overlooking something. Especially since I see an order of m

Re: Boo who?

2004-12-20 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: ... > > You keep using that word. I do not think it means what you think it means. > > I agree. I also like the quote. Seconded -- "The Princess Bride" is a well-worth-quoting masterpiece. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: odbc script

2004-12-20 Thread Chris
Thanks Benji, I took your advice and added in the conn.commit() into the script but still had the same problem. I did some digging around the odbc documentation and found this bug: *

Re: newbie question

2004-12-20 Thread Stephen Thorne
On Mon, 20 Dec 2004 18:06:36 -0600, Doug Holton <[EMAIL PROTECTED]> wrote: > To actually answer your question, no, there is no standard for enums in > python. There are custom hacks for it that you can search for. > > This is a good sugestion for Python 3.0, a.k.a. Python 3000: > http://www.pytho

Re: Easy "here documents" ??

2004-12-20 Thread Bengt Richter
On Mon, 20 Dec 2004 18:58:09 -0600, Doug Holton <[EMAIL PROTECTED]> wrote: >> Jim Hill wrote: >> >>> Is there a way to produce a very long multiline string of output with >>> variables' values inserted without having to resort to this wacky >>> >>> """v = %s"""%(variable) > >No, it is currently n

Re: Is this a good use for lambda

2004-12-20 Thread Alan G Isaac
I need a clarification of the argument. Are the opponents saying that I should not be able to: def compose(list_of_functions): return reduce(lambda f, g: lambda x: f(g(x)), list_of_functions) In a nutshell: why? And may I see the proposed "better" replacement for function composition. Thanks, Al

Re: Easy "here documents" ??

2004-12-20 Thread Doug Holton
Bengt Richter wrote: variable1 = 1 variable2 = 2 s = """ v = ${variable1} v2's value is: ${variable2} """ However, Python 3.0 is likely years away. If you want to know how to run code like this today, consult Fredrik Lundh. Or replace ${...} with equally simple %(...)s in the above and be ha

Re: BASIC vs Python

2004-12-20 Thread Doug Holton
Michael Hoffman wrote: Gregor Horvath wrote: > Or make any given standard python object accessible from MS Excel in 2 > minutes. from win32com.client import Dispatch xlApp = Dispatch("Excel.Application") xlApp.Visible = 1 xlApp.Workbooks.Add() xlApp.ActiveSheet.Cells(1,1).Value = 'Python Rules!'

Re: expression form of one-to-many dict?

2004-12-20 Thread Doug Holton
Mike Meyer wrote: Personally, I'd love a language feature that let you create a function that didn't evaluate arguments until they were actually used - lazy evaluation. That lets you write the C ?: operator as a function, for a start. Hmmm. No, iterators can't be used to fake it. Oh well. That is a

Re: BASIC vs Python

2004-12-20 Thread Doug Holton
Mike Meyer wrote: Logo (my pick) has been called "Lisp without the parenthesis". It has the advantage of using standard algebraic notation for formulas, instead of operator post or pre. This is comp.lang.python, not comp.lang.logo. Please refrain from discussing topics not related to CPyt

sql server support from linux

2004-12-20 Thread Simon Wittber
I am currently tasked with connecting Python CGI programs, under Apache2 / Linux, to SQL Server on Windows 2000. The latest MSSQL module from http://www.object-craft.com.au/projects/mssql/ (0.09) will not (for me, at least) compile on Debian. The next version of the module (0.08) will compile, but

Re: expression form of one-to-many dict?

2004-12-20 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Personally, I'd love a language feature that let you create a function > that didn't evaluate arguments until they were actually used - lazy > evaluation. That lets you write the C ?: operator as a function, for > a start. > > Hmmm. No, iterators can't be u

Re: Python To Send Emails Via Outlook Express

2004-12-20 Thread Ganesan R
> "ian" == ian <[EMAIL PROTECTED]> writes: > Hi Max, > Thanks for the suggestion. I'm always open to new ideas. > Can you please tell me how to retrieve the default account settings > from Outlook Express? s.Configuration.Load(2) is supposed to do exactly that. I have no clue why that didn'

Re: Python To Send Emails Via Outlook Express

2004-12-20 Thread ian
Hi Ganesan, I'm on the verge of giving up I don't suppose you could write a small script to send the email for me via the default windows email client. I will then try running your script and my end to see if it works ok. I may have missed something and would really appreciate your help. Thanks in

Re: expression form of one-to-many dict?

2004-12-20 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Bengt Richter) writes: > > > On Sun, 19 Dec 2004 21:29:27 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > (or maybe a restricted unquote_arg function for better safety). > > E.g., double back-tick is a syntax error now, so you could

Re: expression form of one-to-many dict?

2004-12-20 Thread Fernando Perez
Doug Holton wrote: > Mike Meyer wrote: > >> Personally, I'd love a language feature that let you create a function >> that didn't evaluate arguments until they were actually used - lazy >> evaluation. That lets you write the C ?: operator as a function, for >> a start. >> >> Hmmm. No, iterators

Should I always call PyErr_Clear() when an exception occurs?

2004-12-20 Thread Jaime Wyant
I've found that the code below will crash if I don't have the PyErr_Clear() function call. Should I always call PyErr_Clear()? The error message I get has to do with garbage collection --> Exception exceptions.ImportError: 'No module named badmodule' in 'garbage collec tion' ignored Fatal Python

Re: editing XML via DOM

2004-12-20 Thread Stephen Thorne
On Mon, 20 Dec 2004 21:45:14 +0100, jaco <[EMAIL PROTECTED]> wrote: > Hi, > > I'm new to Python and XML but still I want to create something that > includes creating and editing XML using Python. > > Now I'm looking for a little example program that does (some of) this to > set me on my way. > >

Re: sql server support from linux

2004-12-20 Thread vincent wehren
Simon Wittber wrote: I am currently tasked with connecting Python CGI programs, under Apache2 / Linux, to SQL Server on Windows 2000. The latest MSSQL module from http://www.object-craft.com.au/projects/mssql/ (0.09) will not (for me, at least) compile on Debian. The next version of the module (0.0

Re: Should I always call PyErr_Clear() when an exception occurs?

2004-12-20 Thread Tim Peters
[Jaime Wyant] > I've found that the code below will crash if I don't have the > PyErr_Clear() function call. Should I always call PyErr_Clear()? That's not the right approach. Nearly all Python C API calls can fail. They return a special value if they do, primarily NULL for a call that returns

Re: Python To Send Emails Via Outlook Express

2004-12-20 Thread Ganesan R
> "ian" == ian <[EMAIL PROTECTED]> writes: > Hi Ganesan, > I'm on the verge of giving up > I don't suppose you could write a small script to send the email for me > via the default windows email client. I can see no easy way to do this. Though you can access the default mail client using a

Re: embedding: forcing an interpreter to end

2004-12-20 Thread Miki Tebeka
Hello dan, > > How about: PyRun_String("from os import _exit; > > _exit(0)") ? > > Clever! But, _exit() will terminate my entire > process, not just the offending interpreter. And I > can't use a separate child process on uclinux. You have a Python port to uClinux? > Any other ideas? 1. Maybe

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Fredrik Lundh
Terry Reedy wrote: > This I again agree with. I understand that Prothon is also a *different* > though Python inspired > language. Also that it is still under development. http://www.prothon.org/ "All work on Prothon has been halted" (the site is pointing to a new project, Pycs, whose s

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Erik Max Francis
Fredrik Lundh wrote: (the site is pointing to a new project, Pycs, whose site is pointing to a new project, Spry, "the first dynamic language to have all the best capabilities of Python, Prothon, and C# (actually C-Omega) in one language", on which "work has rarely begun") How bizarre is it that th

Re: BASIC vs Python

2004-12-20 Thread Jeremy Bowers
On Mon, 20 Dec 2004 22:41:00 -0600, Doug Holton wrote: > This is comp.lang.python, not comp.lang.logo. Please refrain from > discussing topics not related to CPython. This is comp.lang.python, not alt.holton.doug.doug.doug. Please spend less energy on dictating community standards and a more ene

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Fredrik Lundh
Doug Holton wrote: > Do you have financial conflict of interest too like Fredrik? I suggest you do your homework, and post an apology. Immediately. -- http://mail.python.org/mailman/listinfo/python-list

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Fredrik Lundh
James Stroud wrote: >I think the python community should be prepared to accept an increasing number > of people who just want to get something done with whatever tools they have > available (windows, mac, .net, etc) and with whatever skills they already > have acquired. you know, I've been workin

Re: Is this a good use for lambda

2004-12-20 Thread Fredrik Lundh
Alan G Isaac wrote: > Are the opponents saying that I should not be able to: > > def compose(list_of_functions): return reduce(lambda f, g: lambda x: > f(g(x)), list_of_functions) > > In a nutshell: why? I was about to reply, but I couldn't figure out what the piece of code does in the allotted t

Re: Printing

2004-12-20 Thread Craig Ringer
On Tue, 2004-12-21 at 06:45, Jim & Joanne Collins wrote: > I've completed a semester of computer programming in Python and one > thing we didn't learn was how to send data to a windows printer > instead of the screen. It would be helpful to know what graphical toolkit and canvas widget you are usi

Re: BASIC vs Python

2004-12-20 Thread Leif K-Brooks
Mike Meyer wrote: They do have a first-class function-like object called an agent. But to use a standard method as an agent, you have to wrap it. Just curious, but how does a method get wrapped in an agent if methods aren't first-class objects? Subclassing the agent base class with a new run meth

Re: newbie question

2004-12-20 Thread Fredrik Lundh
Stephen Thorne wrote:' > Is this a Sig? What is this referring to? You've said it in reply to > more than one post in the last week. Got a url I can read about the > Fredrik Lundh Python Syntax Manglation Consulting Service? it's the new Boo marketing motto: "have you harrassed a Pythoneer today?

Re: Printing

2004-12-20 Thread Fredrik Lundh
Jim & Joanne Collins wrote: > I've completed a semester of computer programming in Python > and one thing we didn't learn was how to send data to a windows > printer instead of the screen. I've also asked this question in one > of the Python help places and received about three responses. > None

<    1   2   3