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

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: 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: 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: 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: 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: 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: 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 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: 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: 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: 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: 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: 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: 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. > >

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: 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

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: 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: 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: 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

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: 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

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
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: 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: 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 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: 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: 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: 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: 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? (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
[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 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: 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: 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 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: 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 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: 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 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Writev

2004-12-20 Thread Mike Meyer
Adam DePrince <[EMAIL PROTECTED]> writes: > I want to include it because POSIX has a single OS call that > conceptually maps pretty closely to writelines. I just want to point out that on some systems, POSIX is a compatability layer, not an OS layer. On those systems, the implementer of writev is

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

2004-12-20 Thread Doug Holton
Peter Hansen wrote: Doug Holton wrote: Peter Hansen wrote: "Virtually identical" indeed. :-) As noted on the website that I've pointed out to you multiple times now, the syntax of boo is indeed virtually identical to python. The functionality however, is more like C#. Sadly your second post ha

Re: Parallelization with Python: which, where, how?

2004-12-20 Thread Michael Hoffman
Mathias wrote: I have a (pretty much) "emberassingly parallel" problem and look for the right toolbox to parallelize it over a cluster of homogenous linux workstations. We have a >1000-node cluster here and use the commercial Platform LSF to manage it. My Poly package

Re: from vb6 to Python

2004-12-20 Thread djlawler
There is a really good IDE for python - wxpython - wxwidgets called boa constructor. It is very 'Visual Basic like'. http://boa-constructor.sourceforge.net/ I highly recommend it. I works well whether you want to use the built in features to create applications - or 'do it yourself'. It even h

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

2004-12-20 Thread Luis M. Gonzalez
Terry Reedy wrote: > > [gratuitously] I agree with this... > well, my english is bad. I know! > > but I think this is silly. PyPy is an alternate implementation of Python, > not a different language. Stackless is a compiled extension, like many > others, that works with the standard implementat

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

2004-12-20 Thread James Stroud
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. For example (having been in this situation before) a

Re: Operators as functions

2004-12-20 Thread Peter Nuttall
On Monday 20 Dec 2004 22:44, Anders Andersson wrote: > Hello > > I want to concatinate (I apologize for bad English, but it is not my > native language) a list of strings to a string. I could use (I think): > > s = "" > map(lambda x: s.append(x), theList) > > But I want to do something like (I thin

Re: Operators as functions

2004-12-20 Thread Steven Bethard
Peter Hansen wrote: However, none of this is considered the best approach these days, with the advent of list comprehensions and generator expressions. Here's the old approach (shown above) and the shiny new modern Pythonic approach (requires Python 2.4): >>> theList = range(10) >>> import operat

Re: A rational proposal

2004-12-20 Thread Mike Meyer
[EMAIL PROTECTED] (Christopher A. Craig) writes: > I've been thinking about doing this for a while. cRat > (http://sf.net/projects/pythonic) already meets these qualifications > except that I need to add decimal support to it now that decimals are > in the language. I could rewrite the existing

Re: Operators as functions

2004-12-20 Thread Peter Hansen
Anders Andersson wrote: I want to concatinate (I apologize for bad English, but it is not my native language) a list of strings to a string. I could use (I think): s = "" map(lambda x: s.append(x), theList) But I want to do something like (I think that the code above is clumsy): s = reduce("conca

Re: Operators as functions

2004-12-20 Thread Steve Holden
Anders Andersson wrote: Hello I want to concatinate (I apologize for bad English, but it is not my native language) a list of strings to a string. I could use (I think): s = "" map(lambda x: s.append(x), theList) But I want to do something like (I think that the code above is clumsy): s = reduce(

Operators as functions

2004-12-20 Thread Anders Andersson
Hello I want to concatinate (I apologize for bad English, but it is not my native language) a list of strings to a string. I could use (I think): s = "" map(lambda x: s.append(x), theList) But I want to do something like (I think that the code above is clumsy): s = reduce("concatinating function"

Re: gridbaglayout

2004-12-20 Thread Neil Benn
[EMAIL PROTECTED] wrote: Friends - I have tried to do abolute positioning using gridbaglayout, but am having no success in jython. One book I have been referencing says that it only works with JPanels. Could someone post a snippet of code that works for a button? I am so close so just a hint would

Re: MIDI library recommendations, please?

2004-12-20 Thread Jan Dries
Andrew Koenig wrote: Are there widely used and recommended Python libraries that will let me 1) Interpret and generate MIDI messages easily? I'm not sure this is "widely used and recommended" but I've used the following in the past: http://sgce.cbse.uab.edu/SoundOfSequence/midi/midi.py It's s

Re: A rational proposal

2004-12-20 Thread François Pinard
[Batista, Facundo] > To convert a Decimal to Rational, [...] Hi, people. I am not closely following this thread and do not know if this has been discussed before. Sorry if I'm repeating known arguments... Decimal to Rational is easy. The interesting problem is how to best convert a float to R

Printing

2004-12-20 Thread Jim & Joanne Collins
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 of them worked.   I'm totally a

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

2004-12-20 Thread Terry Reedy
"Luis M. Gonzalez" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > As for the first ones, there's no reason to bash this project > gratuitelly. [gratuitously] I agree with this... > It is as important and "python related" as other projects > such as PyPy, Stackless, but I think t

Re: Oddity in 2.4 with eval('None')

2004-12-20 Thread Raymond Hettinger
"Leif K-Brooks" <[EMAIL PROTECTED]> > In Python 2.4, although None can't be directly assigned to, > globals()['None'] can still be; however, that won't change the value of > the expression "None" in ordinary statements. Except with the eval > function, it seems: > > Python 2.4 (#2, Dec 3 2004, 17:

Re: input record sepArator (not sepErator)

2004-12-20 Thread Peter Otten
Terry Reedy wrote: > 'separate' (se-parate == take a-part) and its derivatives are perhaps the > most frequently misspelled English word on clp. Seems to be 'par' for the > course. It has 2 e's bracketing 2 a's. It derives from the Latin > 'parare', as does pare, so 'par' is the essential root

Re: Best GUI for small-scale accounting app?

2004-12-20 Thread Luke Skywalker
On 20 Dec 2004 13:28:02 -0800, "John Machin" <[EMAIL PROTECTED]> wrote: >Babelfish gave up on "durchzuwursteln" and so did I -- >"through-to-sausage-???" This is getting erotic ;-) Luke. -- http://mail.python.org/mailman/listinfo/python-list

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

2004-12-20 Thread Luis M. Gonzalez
Istvan Albert wrote: > All that boo does is borrows a few syntactical constructs > from python. Calling it virtually identical > is *very* misleading. That's right. I wouldn't say it is *virtually identical* because Boo is not Python (and this was clearly stated in its web site). It is an static

Re: extending python with a C-written dll

2004-12-20 Thread Fredrik Lundh
John Machin wrote: > By the way, lcc also *appears* to change "...Module3" to "...Module4" :-) $ more Include/modsupport.h ... #define Py_InitModule3(name, methods, doc) \ Py_InitModule4(name, methods, doc, (PyObject *)NULL, \ PYTHON_API_VERSION) ... -- ht

Re: Oddity in 2.4 with eval('None')

2004-12-20 Thread Fredrik Lundh
Leif K-Brooks wrote >> Yes. "print eval('None')" is printing the value of None as defined in your >> module's global >> namespace: > > Right, but why? The expression "None" doesn't worry about the global > namespace when used in normal > code; why does it when used in eval()ed code? from what

Re: List limits

2004-12-20 Thread Raymond Hettinger
> How many items can be stored in a Python list? I have close to 70,000 > items... is this within a lists limits? Lists store pointers to objects. Unless you have a lot of duplicates, it is the objects themselves that will consume most of your memory. The list itself will likely be small in comp

Re: Best GUI for small-scale accounting app?

2004-12-20 Thread John Machin
Thomas Heller wrote: > Bulba! <[EMAIL PROTECTED]> writes: > > > I'll soon start development of a specialized small app and need > > to choose GUI for it. > > Quoting a somewhat popular german blogger, on the state of cross > platform Python GUI toolkits (http://blog.schockwellenreiter.de/7282): >

Re: Oddity in 2.4 with eval('None')

2004-12-20 Thread Steve Holden
Leif K-Brooks wrote: Steve Holden wrote: Yes. "print eval('None')" is printing the value of None as defined in your module's global namespace: Right, but why? The expression "None" doesn't worry about the global namespace when used in normal code; why does it when used in eval()ed code? I have n

Re: extending python with a C-written dll

2004-12-20 Thread John Machin
Jean-Baptiste PERIN wrote: > Hi, > > I'm trying to make a windows dll reachable from a python script .. and > I'm encountering troubles during link step .. > > I use "lcc" to compile and link > I use python 2.3 under win XP [snip] > Here are the errors : > - > Error c:\...\plug

Re: MIDI library recommendations, please?

2004-12-20 Thread Carlos Ribeiro
On Mon, 20 Dec 2004 19:56:30 GMT, Andrew Koenig <[EMAIL PROTECTED]> wrote: > Are there widely used and recommended Python libraries that will let me > > 1) Interpret and generate MIDI messages easily? > > 2) Allow me to select and communicate with MIDI devices attached to my > computer?

Re: Oddity in 2.4 with eval('None')

2004-12-20 Thread Leif K-Brooks
Steve Holden wrote: Yes. "print eval('None')" is printing the value of None as defined in your module's global namespace: Right, but why? The expression "None" doesn't worry about the global namespace when used in normal code; why does it when used in eval()ed code? -- http://mail.python.org/mail

Re: Web forum (made by python)

2004-12-20 Thread Valentino Volonghi aka Dialtone
<[EMAIL PROTECTED]> wrote: > Don't see anything in PyPI. Do I have to write everything myself? Gah. > I need more beer. I'm writing it in my spare time (which is not enough however). You can find the url in the sign. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.3.6 Blog: http://vvo

RE: A rational proposal

2004-12-20 Thread Batista, Facundo
Title: RE: A rational proposal [Mike Meyer] #- Good point. Currently, objects now how to convert themselves to int, #- float and complex. Should Rational now how to convert itself to #- Decimal (and conversely, decimal now how to convert itself to #- Rational)? To convert a Decimal to Rati

editing XML via DOM

2004-12-20 Thread jaco
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. Is there something like this available or can somebody give me some example lines t

Re: Best GUI for small-scale accounting app?

2004-12-20 Thread Kevin Walzer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Diez B. Roggisch wrote: |>Question for you, does Qt use the native Windows dialogs and widgets or |>does it use its own? If the latter, how close are they to the native |>look? Will they change appearance when a user chooses a different |>theme in the

Re: MIDI library recommendations, please?

2004-12-20 Thread Max M
Andrew Koenig wrote: Are there widely used and recommended Python libraries that will let me 1) Interpret and generate MIDI messages easily? Yes. http://www.mxm.dk/products/public/pythonmidi 2) Allow me to select and communicate with MIDI devices attached to my computer? There are some pr

Re: Oddity in 2.4 with eval('None')

2004-12-20 Thread M.E.Farmer
Python 2.2.2 (#37, Nov 26 2002, 10:24:37) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> dir() ['__builtins__', '__doc__', '__name__', 'shell'] >>> globals()['None'] Traceback (most recent call last): File "", line 1, in ? KeyError: None >>>

Re: Easy "here documents" ??

2004-12-20 Thread Nick Craig-Wood
Jim Hill <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > >I prefer this > > > > ... I'll have %(amount)s %(what)s > > ... for $%(cost)s please""" % locals() > > Looks pretty slick. This might just be what I need. > > >Its almost as neat as perl / shell here documents and emacs parse

Re: Recursive structures

2004-12-20 Thread bearophileHUGS
Leif K-Brooks: >http://python.org/doc/current/lib/module-pprint.html#l2h-749 Thank you very much, I see that the function is already there, even with the same name :-) I've seen that it doesn't work for all my tests, like this one with n = 3000: from pprint import isrecursive from time import cl

Re: type method-wrapper?

2004-12-20 Thread Terry Reedy
"Thomas Guettler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, l=[] print type(l.__delattr__) # --> I didn't find a corresponding type in the modules "types". Is it missing or am I blind? (Python 2.3.3) method_wrapper is an implementation type, not a language type in the sa

Re: input record seperator (equivalent of "$|" of perl)

2004-12-20 Thread Fredrik Lundh
Scott David Daniels wrote: > True. The 2.4 document says that itertools.groupby() is equivalent to: > > class groupby(object): > So you could always just use that code. the right way to do that is to use the Python version as a fallback: try: from itertools import groupby ex

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

2004-12-20 Thread Istvan Albert
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. I've downloaded and tried it when you first made this claim and it turned out that boo couldn't

Re: Best GUI for small-scale accounting app?

2004-12-20 Thread Carlos Ribeiro
On 20 Dec 2004 07:47:53 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Bulba! <[EMAIL PROTECTED]> writes: > > "Your CherryPy powered web applications are in fact stand-alone Python > > applications embedding their own web server. You can deploy them > > anywhere you can run Python appl

Re: Oddity in 2.4 with eval('None')

2004-12-20 Thread Steve Holden
Leif K-Brooks wrote: In Python 2.4, although None can't be directly assigned to, globals()['None'] can still be; however, that won't change the value of the expression "None" in ordinary statements. Except with the eval function, it seems: Python 2.4 (#2, Dec 3 2004, 17:59:05) [GCC 3.3.5 (Debi

Re: Web forum (made by python)

2004-12-20 Thread and-google
Choe, Cheng-Dae wrote: > example site is http://bbs.pythonworld.net:9080/pybbs.py Since this seems quite happy to accept posted

Re: input record sepArator (not sepErator)

2004-12-20 Thread Terry Reedy
'separate' (se-parate == take a-part) and its derivatives are perhaps the most frequently misspelled English word on clp. Seems to be 'par' for the course. It has 2 e's bracketing 2 a's. It derives from the Latin 'parare', as does pare, so 'par' is the essential root of the word. My gripe fo

Re: mod_python and xml.sax

2004-12-20 Thread Fredrik Lundh
Jeffrey Froman wrote: >I am having difficulty getting mod_python and xml.sax to play nicely with > each other. I am using: > > Python 2.4 > Mod_python 2.7.10 > Apache 1.3.33 > > Using the mod_python.publisher handler to invoke the go function in the > following script: > > from xml.sax import make

Oddity in 2.4 with eval('None')

2004-12-20 Thread Leif K-Brooks
In Python 2.4, although None can't be directly assigned to, globals()['None'] can still be; however, that won't change the value of the expression "None" in ordinary statements. Except with the eval function, it seems: Python 2.4 (#2, Dec 3 2004, 17:59:05) [GCC 3.3.5 (Debian 1:3.3.5-2)] on lin

Re: extending python with a C-written dll

2004-12-20 Thread Jean Brouwers
First, you might check the calldll module available here Take a look at Pyrex, it may fit your requirements to access C from Python. If you do not have these already, you may need the Win32 API e

MIDI library recommendations, please?

2004-12-20 Thread Andrew Koenig
Are there widely used and recommended Python libraries that will let me 1) Interpret and generate MIDI messages easily? 2) Allow me to select and communicate with MIDI devices attached to my computer? I know that (2) is platform-dependent, so if there isn't a multiplatform version of (

  1   2   3   >