Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Terry Hancock
On Wednesday 06 July 2005 09:41 am, Steven Bethard wrote: > Terry Hancock wrote: > > And a syntax just occured to me -- what about this: > > [ for ] > > If you haven't already, see: > http://wiki.python.org/moin/AlternateLambdaSyntax > for other similar proposals. Yeah, it's basically "Robert Bre

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-07 Thread Terry Reedy
"Stian Søiland" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On 2005-07-06 02:46:27, George Sakkis wrote: >> So, who would object the full-word versions for python 3K ? >> def -> define >> del -> delete >> exec -> execute >> elif -> else if >Objections for the "else if" might be

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Terry Hancock
On Wednesday 06 July 2005 08:38 am, Tom Anderson wrote: > On Wed, 6 Jul 2005, Terry Hancock wrote: > > With list comprehensions and generators becoming so integral, I'm > > not sure about "unpythonic". > > I'm going to resist the temptation to argue that list comps are themselves > unpythonic :).

Re: Do a "Python beginners e-mail list" exist?

2005-07-07 Thread Ed Leafe
On Jul 7, 2005, at 3:24 AM, Alessandro Brollo wrote: > 1. I don't want to post banal questions about Python > to main Python list. Does a "banal Python questions > list" or a "Python beginners list" exist? > > 2. There is somewhere a very patient fellow willing to > be my free "python tutor" by pe

Re: print values from Py_BuildValue

2005-07-07 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > How do i print values returned by Py_BuildValue in Linux? > > PyObject *obj = Py_BuildValue("{s:i}", "Status", status); > > I need to print the Status value here I'm confused. You say you need to print the Status value here, but then you also say you want to print the

Re: question about introspection using inspect module

2005-07-07 Thread Benjamin Rutt
Fernando Perez <[EMAIL PROTECTED]> writes: > I certainly don't want to discourage you from learning about python > introspection, it's one of the most fun aspects of the language. But just as > an FYI, the pydoc system already does much of what you have in mind, at least > if I'm reading your des

Re: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Joseph Garvin
Everyone complaining about Eclipse in this thread needs to go try 3.1. The interface is much much much more responsive. Also, everyone keeps discussing Eclipse as something that gives Java a leg up on Python. *Ahem* PyDev :) Which you should also give another try if you haven't in a few version

Re: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Paul Rubin
Joseph Garvin <[EMAIL PROTECTED]> writes: > Also, everyone keeps discussing Eclipse as something that gives Java a > leg up on Python. *Ahem* PyDev :) Which you should also give another > try if you haven't in a few versions. Easiest way to get a GUI > debugger for python. Can you give a brief de

Options to integrate Python modules into native windows applications

2005-07-07 Thread Philippe C. Martin
Hi, I am looking for the pros and cons as to how to integrate a Python module into a Windows native application. So far I have looked at 1) coding the C wrapper myself 2) using Pyrex 3) go for pywin32 and COM Thanks, Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp development with macros faster than Python development?..

2005-07-07 Thread jayessay
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "jayessay" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > 1. Someone recently remarked that good Lisp macros are basically > > executable pseudo code. I think that is pretty much exactly right > > and is a pretty good "sound bite

Re: Calculating average time

2005-07-07 Thread GregM
Thanks Skip. As usual I want to make it harder then it actually is. -- http://mail.python.org/mailman/listinfo/python-list

Re: print values from Py_BuildValue

2005-07-07 Thread John Machin
[EMAIL PROTECTED] wrote: > Hello, > > How do i print values returned by Py_BuildValue in Linux? 1. The same way as you would "in" any other operating system. 2. With difficulty. 3. If you must print something from C, print the C components (no difficulty). 4. If you are interested in checking wh

Re: question about introspection using inspect module

2005-07-07 Thread Fernando Perez
Benjamin Rutt wrote: > Fernando Perez <[EMAIL PROTECTED]> writes: > >> I certainly don't want to discourage you from learning about python >> introspection, it's one of the most fun aspects of the language. But just >> as an FYI, the pydoc system already does much of what you have in mind, at >>

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Ron Adam wrote: > Reinhold Birkenfeld wrote: >> Ron Adam wrote: >>>(a) == () >> >> >> Whoops! a (which is None) is equal to the empty tuple (which is not None)? > > It's not an empty tuple, it's an empty parenthesis. Using tuples it > would be. But empty parenthesis a

Re: Use cases for del

2005-07-07 Thread Peter Hansen
Duncan Booth wrote: > Peter Hansen wrote: >>Tom Anderson wrote: >>>How about just getting rid of del? >> >>Arguing the case for del: how would I, in doing automated testing, >>ensure that I've returned everything to a "clean" starting point in all >>cases if I can't delete variables? Sometimes

Re: Options to integrate Python modules into native windows applications

2005-07-07 Thread Larry Bates
pywin32 and COM is good. Seems to work for me. Other methods (services, sockets, pipes, etc.) can also work well, but it depends on what you want to do and how you wish to communicate between the modules. Larry Bates Philippe C. Martin wrote: > Hi, > > I am looking for the pros and cons as to

Re: Determining actual elapsed (wall-clock) time

2005-07-07 Thread Peter Hansen
zooko wrote: > The traditional use of gettimeofday() to (insecurely and unreliably) > approximate elapsed local time is one of my pet peeves. > > Fortunately a real monotonic clock has finally been added to the linux > kernel and glibc: > > http://www.imperialviolet.org/page24.html#e474 Interest

Re: threads and sleep?

2005-07-07 Thread Peter Hansen
Jonathan Ellis wrote: > Peter Hansen wrote: >>I can't address the issue of whether or not "most" such projects require >>distributed locking, because I'm not familiar with more than half of >>such projects, as you appear to be. > > Your sarcasm is cute, I suppose, but think about it for a minute.

Upgrading from Python 2.2 to 2.4 (can't find _ssl.pyd)

2005-07-07 Thread Larry Bates
Well I'm still on my "quest". I've been putting this off for quite some time because I KNEW it was going to be hard. I tried to wait a while to upgrade to let all these things become readily available. So far Sam Rushing has been my hero in putting updated versions (2.4) of calldll and npstruct

Re: threads and sleep?

2005-07-07 Thread Peter Hansen
Grant Edwards wrote: > On 2005-07-06, Peter Hansen <[EMAIL PROTECTED]> wrote: >>Maybe you should consider and explain what you mean by >>"multiple interpreters"? > > That in a multi-theraded Python program, the code that > impliments the Python VM is executing "simultaneously" in > multiple contex

import Help Needed - Newbie

2005-07-07 Thread Dan
Hi I am trying to learn Python with the "Dive Into Python" book coming from VB, but am getting stuck at Example 2.3 (http://www.diveintopython.org/getting_to_know_python/everything_is_an_object.html). Here is what I get following the book's directions for: >>> import odbchelper Traceback

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Christopher Subich
Terry Hancock wrote: > With list comprehensions and generators becoming so integral, I'm > not sure about "unpythonic". And a syntax just occured to me -- > what about this: > > [y*x for x,y] > > ? > > (that is: > > [ for ] > > It's just like the beginning of a list comprehension or generator

Re: Upgrading from Python 2.2 to 2.4 (can't find _ssl.pyd)

2005-07-07 Thread Larry Bates
Never mind. Seems that the standard distribution at www.python.org has it included (I was using ActiveState). FYI, Larry Larry Bates wrote: > Well I'm still on my "quest". I've been putting this > off for quite some time because I KNEW it was going to > be hard. I tried to wait a while to upgr

Re: Options to integrate Python modules into native windows applications

2005-07-07 Thread Philippe C. Martin
Thanks Larry, I want to: 1) Modify my code as little as possible 2) Please/reassure the lambda VB or VC++ oriented company Regards, Philippe Larry Bates wrote: > Other methods (services, sockets, pipes, etc.) > can also work well, but it depends on what you > want to do and how you wish to

Re: Windows Cmd.exe Window

2005-07-07 Thread [EMAIL PROTECTED]
> In the past I have created .bat wrapper files that just call the python > interpreter, but it is a bit tedious to have to create a matching .bat > file for every script. So I came up with the following approach... > I frequently use a batch file wrapper. Typically it has a long friendly name

Re: import Help Needed - Newbie

2005-07-07 Thread GregM
A search on google for odbchelper resulted in: http://linux.duke.edu/~mstenner/free-docs/diveintopython-3.9-1/py/odbchelper.py I think this will help you. Greg. -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and sleep?

2005-07-07 Thread Grant Edwards
On 2005-07-07, Peter Hansen <[EMAIL PROTECTED]> wrote: >>>Maybe you should consider and explain what you mean by >>>"multiple interpreters"? >> >> That in a multi-theraded Python program, the code that >> impliments the Python VM is executing "simultaneously" in >> multiple contexts: one for each

publishing an already instantiated class

2005-07-07 Thread J
Hi everyone, Thanks for your awsome replies. I started replacing Javascript with python 2 days ago and I already have my first scripts running. Mainly due to the wealth of information in this blog. I have a C++ object that is already instantiated and now I want to give python a reference to it...

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Tony Meyer
> Everyone complaining about Eclipse in this thread needs to go > try 3.1. The interface is much much much more responsive. The problem with Eclipse, IMO, is Java. I've tried 3.1 on a WinXP machine and, like just about any Java program, it's incredibly slow and a real pain to use. On a (similar

Re: Thoughts on Guido's ITC audio interview

2005-07-07 Thread George Sakkis
"Tony Meyer" <[EMAIL PROTECTED]> wrote: > The problem with Eclipse, IMO, is Java. I've tried 3.1 on a WinXP machine > and, like just about any Java program, it's incredibly slow and a real pain > to use. On a (similarly spec'd) Mac OS X Tiger machine, it runs nice and > smoothly and is reasonabl

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Tony Meyer
> Your first sentence contradicts the rest of your post; how is > Java the problem if it runs nice on a Mac and is sluggish on > Windows ? Because any Java program on (any version of) Windows (in my experience) is sluggish, and this is not true (again, in my experience) for Java programs on a Ma

Re: publishing an already instantiated class

2005-07-07 Thread J
I think I just found my own solution, so I will record it for future references I did this in my Constructor of X { PyStruct* lObject; lObject = PyObject_New(PyStruct, &X::PyType); lObject->mObject = this; } What does everyone think about this. I am posting a little bit out of the hip

Re: Use cases for del

2005-07-07 Thread George Sakkis
"Grant Edwards" <[EMAIL PROTECTED]> wrote: > On 2005-07-07, George Sakkis <[EMAIL PROTECTED]> wrote: > > > I guess he means why not define foo as property: > > > > class demo(object): > > foo = property(fget = lambda self: self.v, > >fset = lambda self,v: setattr(self,'v',v

Re: math.nroot [was Re: A brief question.]

2005-07-07 Thread Tim Peters
[Tim Peters] All Python behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent accident, mostly inherited from that all C89 behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent crapshoot. [Michael Hudson] >>> A

Is there an easy way to get at the value of DBL_MAX from Python?

2005-07-07 Thread Steve Juranich
I'm in a situation where it would be nice to have access to this value. I've been looking for it all afternoon and can't find anything. Thanks. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Python exception hook simple example needed

2005-07-07 Thread Ed Leafe
On Jul 7, 2005, at 7:27 AM, Fuzzyman wrote: > Do you have an exception handling dialog ? Not per se, as there hasn't been a request for one; we have several dialogs ranging from simple messages to alerts to interactive dialogs, much as wxPython offers. But I'll make this offer: give me

Re: Thoughts on Guido's ITC audio interview

2005-07-07 Thread George Sakkis
"Tony Meyer" <[EMAIL PROTECTED]> wrote: > > Your first sentence contradicts the rest of your post; how is > > Java the problem if it runs nice on a Mac and is sluggish on > > Windows ? > > Because any Java program on (any version of) Windows (in my experience) is > sluggish, and this is not true (

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Tony Meyer
> "Java" as a term means different things to different people, Agreed. Python is similar in this respect - it's common to refer to cPython here as Python, for example. > but I expect most would think of the core language and its > standard library first and the JRE/JVM second. So saying "the

Re: Is there an easy way to get at the value of DBL_MAX from Python?

2005-07-07 Thread George Sakkis
"Steve Juranich" <[EMAIL PROTECTED]> wrote: > I'm in a situation where it would be nice to have access to this > value. I've been looking for it all afternoon and can't find anything. Where exactly have you been looking ? I guess not in Google, because the fifth result after querying "dbl_max" is

Re: Tkinter grid layout

2005-07-07 Thread Christopher Subich
Eric Brunel wrote: > So you should either make your MainWindow class inherit from Tk, which > eliminates the unneeded container and the problems it may cause, or make > sure the pack or grid on your MainWindow instance actually tells the > container to grow with its container. With pack, it's q

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Delaney, Timothy (Tim)
Tony Meyer wrote: > It would be interesting to know which JRE the Eclipse advocates are > using, and which the people that dislike Eclipse are using... For me, performance is the minor issue. Usability is the major issue. If find Eclipse to be highly unusable, so I don't use it. Tim Delaney --

Re: Is there an easy way to get at the value of DBL_MAX from Python?

2005-07-07 Thread George Sakkis
"George Sakkis" <[EMAIL PROTECTED]> wrote: > Where exactly have you been looking ? I guess not in Google, because > the fifth result after querying "dbl_max" is > http://mail.python.org/pipermail/pythonmac-sig/2002-July/005916.html, > which follows up to > http://mail.python.org/pipermail/pythonma

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Philippe C. Martin
> For me, performance is the minor issue. Usability is the major issue. If > find Eclipse to be highly unusable, so I don't use it. I find it to be the best option out there -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there an easy way to get at the value of DBL_MAX from Python?

2005-07-07 Thread Robert Kern
George Sakkis wrote: > "Steve Juranich" <[EMAIL PROTECTED]> wrote: > > >>I'm in a situation where it would be nice to have access to this >>value. I've been looking for it all afternoon and can't find anything. > > > Where exactly have you been looking ? I guess not in Google, because > the fif

Ann: The first PyWeek Python Game Programming Competition

2005-07-07 Thread pyweek1
The date for the first PyWeek challenge has been set: Sunday 28th August to Sunday 4th September (00:00UTC to 00:00UTC). The PyWeek competition: - Invites all Python programmers to write a game in one week from scratch either as an individual or in a team, - Is intended to be challenging and fun

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Erik Max Francis
Ron Adam wrote: > It's not an empty tuple, it's an empty parenthesis. Using tuples it > would be. > > (a,) == (,) > > which would be the same as: > > (,) == (,) >>> () () >>> a = () >>> type(a) >>> (,) File "", line 1 (,) ^ SyntaxError: invalid syntax You've wandered way

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Ron Adam
Christopher Subich wrote: > As others have mentioned, this looks too much like a list comprehension > to be elegant, which also rules out () and {}... but I really do like > the infix syntax. Why would it rule out ()? You need to put a lambda express in ()'s anyways if you want to use it righ

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Ron Adam
Erik Max Francis wrote: > Ron Adam wrote: > >> It's not an empty tuple, it's an empty parenthesis. Using tuples it >> would be. >> >> (a,) == (,) >> >> which would be the same as: >> >> (,) == (,) > > > >>> () > () > >>> a = () > >>> type(a) > > >>> (,) > File "", line 1 > (,) >

Berkely DB – many writers, many rea ders

2005-07-07 Thread Andy Leszczynski
I need to now option I open the Berkley DB (both db and env) to have configuration for multiple writers and multiple readers. Via multiple processes and multiple threads. No trx needed. A. -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Erik Max Francis
Ron Adam wrote: > Well in my previous explanation I *mean* it to be empty parenthesis. > > Does that help? Maybe it might be beneficial to learn a little more of the language before proposing such wide-reaching (and un-Pythonic) reforms? -- Erik Max Francis && [EMAIL PROTECTED] && http://www.

Integrating a wx.App to a Panel (elegantly)

2005-07-07 Thread flamesrock
Perhaps one of you more experience wxPythoners can assist me. I have two seperate programs and basically I want to integrate program 2, which inherits from wx.App to a wx.Panel on the original program. Is there an elegant way to do this without carefully surgically inserting wx.App 2 into wx.App

Re: calling python procedures from tcl using tclpython

2005-07-07 Thread chand
Hi., can anyone help me how to provide the info about the python file procedure in the tcl script which uses tclpython i.e., is there a way to import that .py file procedure in the tcl script --BestRegards --Chandra Michael Schlenker wrote: > chand wrote: > > Hi.. > > > > I am writing a Gui in

Polling, Fifos, and Linux

2005-07-07 Thread Jeremy Moles
This is my first time working with some of the more lower-level python "stuff." I was wondering if someone could tell me what I'm doing wrong with my simple test here? Basically, what I need is an easy way for application in userspace to simply echo values "down" to this fifo similar to the way pr

Re: f*cking re module

2005-07-07 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 07 Jul 2005 06:47:54 -0400, Chris Smith wrote: >> Oh, come on: what's a Perliodic Table of Operators, between friends? >> http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html > That, and the discussion on operators by Larry Wall, are two

Re: question about introspection using inspect module

2005-07-07 Thread Mike Meyer
Benjamin Rutt <[EMAIL PROTECTED]> writes: > what I am actually trying to do is to build a database of Python > modules. so then later, I can write a tool in my favorite editor > (Emacs) to invoke some forms of completion against this database > (e.g. os.remov or socket. to see a list of all socket

Re: (Win32 API) callback to Python, threading hiccups

2005-07-07 Thread Tim Roberts
Scott David Daniels <[EMAIL PROTECTED]> wrote: >Francois De Serres wrote: >>PyGILState_STATE gil = PyGILState_Ensure(); >>result = PyEval_CallObject(my_callback, arglist); >>PyGILState_Release(gil); >>Py_DECREF(arglist); >>Py_DECREF(re

Re: How do you program in Python?

2005-07-07 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > Hey, it's not fair to make fun of emacs now that I've mentioned vim > favourably so many times ;-) > > Seriously, nothing about emacs seems big or slow today. It has been > outbloated by pretty much everything else. Who could have imagined /that/ > ten yea

Re: Lisp development with macros faster than Python development?..

2005-07-07 Thread Mike Meyer
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'll clarify. A lot of the time I hear arguments against > features that boils down to. It seems that you've lost some of the intent during the boiling. > 1) I don't need it. Is that what you get out of the oft-used "

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Ron Adam
Erik Max Francis wrote: > Ron Adam wrote: > >> Well in my previous explanation I *mean* it to be empty parenthesis. >> >> Does that help? > > > Maybe it might be beneficial to learn a little more of the language > before proposing such wide-reaching (and un-Pythonic) reforms? Hi Erik, Getting

Re: Polling, Fifos, and Linux

2005-07-07 Thread Jacob Page
Jeremy Moles wrote: > This is my first time working with some of the more lower-level python > "stuff." I was wondering if someone could tell me what I'm doing wrong > with my simple test here? > > Basically, what I need is an easy way for application in userspace to > simply echo values "down" to

urllib2 - basic authentication and the put and delete methods

2005-07-07 Thread news.corp.adobe.com
I need to perform basic authentication and I also need to be able to use the put and delete methods to copy files / delete files on a server. Here is how I successfully perform basic authentication to read a page: import urllib2, os, base64 os.sys

Re: Use cases for del

2005-07-07 Thread Steven D'Aprano
Ron Adam wrote: > Steven D'Aprano wrote: >> Er, maybe I'm misunderstanding something here, but surely the most >> obvious case is for default and special function arguments: >> >> def count_records(record_obj, start=0, end=None): >> if end == None: >> end = len(record_obj) >> if s

Re: Conditionally implementing __iter__ in new style classes

2005-07-07 Thread Bengt Richter
On Thu, 07 Jul 2005 22:04:31 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Bengt Richter) writes: > >> On Thu, 07 Jul 2005 09:51:42 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: >> >>>[EMAIL PROTECTED] (Bengt Richter) writes: >>> On Wed, 06 Jul 2005 17:57:42 +0200, Tho

python nested class

2005-07-07 Thread Vedanta Barooah
greetings in a python nested class is it possible to change the value of the parent class's variable without actually creating an instance of the parent class, consider this code: class mother: x=0 def __init__(self): self.x=1 def show(self):

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Christopher Subich
Ron Adam wrote: > Christopher Subich wrote: > >> As others have mentioned, this looks too much like a list >> comprehension to be elegant, which also rules out () and {}... but I >> really do like the infix syntax. > > > Why would it rule out ()? Generator expressions. Mind you, Py3k might w

Re: Use cases for del

2005-07-07 Thread Ron Adam
Steven D'Aprano wrote: > Ron Adam wrote: >> def count_records(record_obj, start=0, end=len(record_obj)): > > > That would work really well, except that it doesn't work at all. Yep, and I have to stop trying to post on too little sleep. Ok, how about... ? def count_records(record_obj, start

mail sending using telnet in python

2005-07-07 Thread praba kar
Dear All, Normally we can send mail using telnet in linux. In the following way [~user]telnet Ipaddress 25 mail from: [EMAIL PROTECTED] 250 o.k(response of from commandline) rcpt to: [EMAIL PROTECTED] 250 o.k(response of from commandline) data 354 go ahead(response of from commandline) Hello

<    1   2