Re: using urllib with ftp?

2006-05-05 Thread Fredrik Lundh
John Salerno wrote: Thanks. So the ftp:// is something different than actually using ftplib to connect to an FTP server, right? I've used both urllib and ftplib, so I know what they do, I just was a little unclear about whether they can sometimes do each other's work as well. urllib uses

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Martin Blume
Philippe Martin schrieb Hi, This code works, but is it appropriate ? l_init = False if True == l_init and 1234 = l_value: print 'l_value is initialized' I know I can do this with a try but ... I am a Python newbie, but I think working with l_value = None would be the most

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
bruno at modulix wrote: Philippe Martin wrote: (snip) l_init really is a boolean parameter and l_value a value that _might_ exist in a shelve. So I just want to have a parameter to a method so if the first value tested is false (l_init) then the second (l_value) does not get tested ...

Best IDE for Python?

2006-05-05 Thread Saurabh Sardeshpande
Pardon if this is already discussed extensively. But what is the best IDE for Python for a newbie? I have experience in C++ and Java and this is the first time I am learning a scripting language. Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: Progamming python without a keyboard

2006-05-05 Thread Benji York
Eric S. Johansson wrote: So if you want to make a serious difference in people's lives from your keyboard, you can help out in two ways. ... Second is working with probably myself and a couple of other folks in gnome at-spi land building a bridge between speech recognition on Windows and

Re: Active Directory Authentication

2006-05-05 Thread Benji York
D wrote: Is it possible to have Python authenticate with Active Directory? Specifically what I'd like to do is have a user enter a username/password, then have Python check the credentials with AD - if what they entered is valid, for example, it returns a 1, otherwise a 0.. Thanks! Install

Re: Active Directory Authentication

2006-05-05 Thread Philippe Martin
Benji York wrote: D wrote: Is it possible to have Python authenticate with Active Directory? Specifically what I'd like to do is have a user enter a username/password, then have Python check the credentials with AD - if what they entered is valid, for example, it returns a 1, otherwise a

Re: Best IDE for Python?

2006-05-05 Thread Doug Bromley
I have a Python IDE review I did a few months back you may want to view:http://www.straw-dogs.co.uk/blog/python-ide-reviewHope that helps. DougOn 5 May 2006 08:28:00 -0700, Saurabh Sardeshpande [EMAIL PROTECTED] wrote: Pardon if this is already discussed extensively. But what is the bestIDE for

Re: Best IDE for Python?

2006-05-05 Thread Fabio Zadrozny
Have you checked: http://wiki.python.org/moin/IntegratedDevelopmentEnvironments I like pydev (for Eclipse), but as I also develop it I might be a little biased, so, I'd reccomend checking it and taking your own conclusions. -- FabioOn 5 May 2006 08:28:00 -0700, Saurabh Sardeshpande [EMAIL

Drop Down Menus...

2006-05-05 Thread bruce
Hi... Never used python, but I have a question regarding Drop Down Menus. Does Python allow me to create a website, that will permit the user to create Drop Down menus that can be initiated with the right mouse click? If it can, is it fairly easy to implement? Thanks -Bruce --

Re: Tuple assignment and generators?

2006-05-05 Thread vdrab
You've been told that quite a few times before that is is not intended for what you used it. I got that. I was cleaning up some code that used is incorrectly immediately after. Some people actually listen to what others tell. Others seem to be driven by the deep desire to make even the

Re: how to remove 50000 elements from a 100000 list?

2006-05-05 Thread Ju Hui
cool! thanks you all! I choose a=set(range(10)) b=set(range(5)) a.symmetric_difference(b) certainly,the real data not range(), I am satisfied the performance of set.difference thank you all again! -- http://mail.python.org/mailman/listinfo/python-list

Re: Best IDE for Python?

2006-05-05 Thread dooscape
Pardon if . . . already discussed Here is a link searching comp.lang.python for best ide http://tinyurl.com/qqtaf -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread bruno at modulix
Philippe Martin wrote: bruno at modulix wrote: Philippe Martin wrote: (snip) l_init really is a boolean parameter and l_value a value that _might_ exist in a shelve. So I just want to have a parameter to a method so if the first value tested is false (l_init) then the second (l_value) does

Re: Best IDE for Python?

2006-05-05 Thread BartlebyScrivener
Pardon if . . . already discussed Here is a link searching comp.lang.python for best ide http://tinyurl.com/qqtaf rick -- http://mail.python.org/mailman/listinfo/python-list

Re: Drop Down Menus...

2006-05-05 Thread alisonken1
Hello Bruce - bruce wrote: Hi... Never used python, but I have a question regarding Drop Down Menus. Does Python allow me to create a website, that will permit the user to create Drop Down menus that can be initiated with the right mouse click? If it can, is it fairly easy to implement?

Re: Drop Down Menus...

2006-05-05 Thread bruno at modulix
bruce wrote: Hi... Never used python, but I have a question regarding Drop Down Menus. Does Python allow me to create a website, Yes. that will permit the user to create Drop Down menus that can be initiated with the right mouse click? Not sure to understand what you mean, but this is

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
bruno at modulix wrote: Philippe Martin wrote: bruno at modulix wrote: Philippe Martin wrote: (snip) l_init really is a boolean parameter and l_value a value that _might_ exist in a shelve. So I just want to have a parameter to a method so if the first value tested is false (l_init) then

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
Fredrik Lundh wrote: Philippe Martin wrote: l_init really is a boolean parameter and l_value a value that _might_ exist in a shelve. So I just want to have a parameter to a method so if the first value tested is false (l_init) then the second (l_value) does not get tested ... because it

RE: Drop Down Menus...

2006-05-05 Thread bruce
I suspect that if an app were to be created that really allowed for Drop Down menus that can be initiated via the right mouse key, the web app would have to be a java app I've seen some web based java apps with this functionality, but never any php/perl.. I didn't think python would be able

Re: how to remove 50000 elements from a 100000 list?

2006-05-05 Thread Peter Otten
Ju Hui wrote: cool! thanks you all! I choose a=set(range(10)) b=set(range(5)) a.symmetric_difference(b) certainly,the real data not range(), I am satisfied the performance of set.difference thank you all again! Be warned that this may /add/ items to a:

[ConfigParser] value with ; and the value blank

2006-05-05 Thread kai
Hello, how can I use/save/read values with ; (start comment) and the value blank? When I write (set) my config file often the part behind the ; disappears. e.g. myKey = startMyValue ; endMyValue Thank's for your hints, Kai -- http://mail.python.org/mailman/listinfo/python-list

MQSeries based file transfers using the pymqi module

2006-05-05 Thread Andrew Robert
Hi everyone, Has anyone developed a pymqi module based file transfer method for use with WebSphere MQSeries v5.3? If so, would it be possible to point me towards examples of how this was done? Any help that can be provided would be greatly appreciated. Thanks --

ConfigParser: values with ; and the value blank

2006-05-05 Thread kai
Hello, I use the ConfigPaserver from Python. how can I use/save/read values with ; (start comment) and the value blank? When I write (set) my config file often the part behind the ; disappears. e.g. myKey = startMyValue ; endMyValue Thank's for your hints, Kai --

Re: Drop Down Menus...

2006-05-05 Thread Colin Gillespie
bruce wrote: Hi... Never used python, but I have a question regarding Drop Down Menus. Does Python allow me to create a website, that will permit the user to create Drop Down menus that can be initiated with the right mouse click? If it can, is it fairly easy to implement? Thanks

to thine own SELF be true...

2006-05-05 Thread Mark Harrison
Is there a way to do something equivalent to import * from self? Perhaps I'm doing something wrong, but I'm having a headache when dealing with class instance data, forgetting to always put the self. prefix For example, in my brain I'm thinking:

Re: ConfigParser: values with ; and the value blank

2006-05-05 Thread André Malo
* kai wrote: I use the ConfigPaserver from Python. how can I use/save/read values with ; (start comment) and the value blank? When I write (set) my config file often the part behind the ; disappears. e.g. myKey = startMyValue ; endMyValue You can't. The ConfigParser treats ; as

Re: Tuple assignment and generators?

2006-05-05 Thread Carl Banks
vdrab wrote: I guess the take-away lesson is to steer clear from any reliance on object identity checks, if at all possible. BINGO! Are there any other such optimizations one should like to know about? You don't have to know about them, as long as you use the operators correctly. ==

Re: [ConfigParser] value with ; and the value blank

2006-05-05 Thread Larry Bates
kai wrote: Hello, how can I use/save/read values with ; (start comment) and the value blank? When I write (set) my config file often the part behind the ; disappears. e.g. myKey = startMyValue ; endMyValue Thank's for your hints, Kai No, but you can write it as:

easy way to dump a class instance?

2006-05-05 Thread Mark Harrison
Is there a way to automatically print all the instance data in a class? This is for debugging, I would like to do something like dump(self) to snapshot the state of the object. Many TIA! Mark -- Mark Harrison Pixar Animation Studios -- http://mail.python.org/mailman/listinfo/python-list

Re: using urllib with ftp?

2006-05-05 Thread John Salerno
Fredrik Lundh wrote: John Salerno wrote: Thanks. So the ftp:// is something different than actually using ftplib to connect to an FTP server, right? I've used both urllib and ftplib, so I know what they do, I just was a little unclear about whether they can sometimes do each other's work as

Re: to thine own SELF be true...

2006-05-05 Thread bruno at modulix
Mark Harrison wrote: Is there a way to do something equivalent to import * from self? (snip) Is there a way to get rid of those the self. references, No. or is this just something I need to get my brain to accept? Yes. And FWIW, from somemodule import * is usually considered bad style.

Re: to thine own SELF be true...

2006-05-05 Thread Duncan Booth
Mark Harrison wrote: For example, in my brain I'm thinking: optc,args=getopt.getopt(args,cmdopts[cmd][0], cmdopts[cmd][1]) but I'm having to type: self.optc,self.args=getopt.getopt(self.args,self.cmdopts[self.c md][0],

Re: easy way to dump a class instance?

2006-05-05 Thread bruno at modulix
Mark Harrison wrote: Is there a way to automatically print all the instance data in a class? This is for debugging, I would like to do something like dump(self) to snapshot the state of the object. def dump(obj): buf = ['%r %s :' % (obj, str(obj)] for name in dir(obj): attr =

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread John J. Lee
Jay Parlar [EMAIL PROTECTED] writes: On May 5, 2006, at 6:35 AM, John J. Lee wrote: [...] I know about nose, but it seems just a little too magical for my tastes, and includes stuff I don't really need. [...] nose actually has very little magic, its operation is quite straightforward. I've

Re: to thine own SELF be true...

2006-05-05 Thread Larry Bates
Mark Harrison wrote: Is there a way to do something equivalent to import * from self? Perhaps I'm doing something wrong, but I'm having a headache when dealing with class instance data, forgetting to always put the self. prefix For example, in my brain I'm thinking:

Re: Is this a good use of __metaclass__?

2006-05-05 Thread Terry Reedy
Joel Hedlund [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Below, you'll find some background info and an executable code example. In the code example I have two ways of doing the same thing. The problem is that the Neat version doesn't work, and the Ugly version that works

Re: to thine own SELF be true...

2006-05-05 Thread Michael Ekstrand
On Fri, May 05, 2006 at 05:08:24PM +, Mark Harrison wrote: Is there a way to get rid of those the self. references, or is this just something I need to get my brain to accept? It's pretty much just something you'll need to get your brain to accept. You can replace self with something

Re: 4 little Python programs

2006-05-05 Thread Terry Reedy
RM [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I had been thinking of releasing some of my little personal apps for a while. So, this finally motivated me to clean them up enough for release. The website is not yet finished, but I couldn't wait to share with you these little

Re: how to remove 50000 elements from a 100000 list?

2006-05-05 Thread Andrew Gwozdziewycz
It's easy in this case: a = range(5, 10) But, I'm just trying to add some humor to this thread :) On May 5, 2006, at 9:36 AM, Ju Hui wrote: I want to remove about 5 elements from a list,which has 10 elements. sample code like below: a=range(10) b=range(4) for x in

Re: Best IDE for Python?

2006-05-05 Thread Christoph Haas
On Fri, May 05, 2006 at 04:50:11PM +0100, Doug Bromley wrote: I have a Python IDE review I did a few months back you may want to view: http://www.straw-dogs.co.uk/blog/python-ide-review Sounds interesting. Could you fix the screenshots? I just get a 404 here. Kindly Christoph P.S.: [Rant

Re: easy way to dump a class instance?

2006-05-05 Thread Carl J. Van Arsdall
Mark Harrison wrote: Is there a way to automatically print all the instance data in a class? This is for debugging, I would like to do something like dump(self) to snapshot the state of the object. Would something like cPickle work? That allows you to dump objects into files as they

Re: cross platform libraries

2006-05-05 Thread Philippe Martin
Through Wine maybe ? Philippe Dennis Lee Bieber wrote: On 4 May 2006 09:57:15 -0700, [EMAIL PROTECTED] declaimed the following in comp.lang.python: I am using python on a linux terminal. I want to shutdown a remote windows box. I found a script which does something like this. My

Re: easy way to dump a class instance?

2006-05-05 Thread Kamilche
Mark Harrison wrote: Is there a way to automatically print all the instance data in a class? print self.__dict__ -- http://mail.python.org/mailman/listinfo/python-list

Re: easy way to dump a class instance?

2006-05-05 Thread [EMAIL PROTECTED]
Some Googling yielded this recipe http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/137951/index_txt, a little test shows promising results of the described recipe. BTW: the Python Cookbook is always a good place to browse with questions other people probably had as well! --

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread Benji York
John J. Lee wrote: ...I wrote something to do this once, but didn't do as good a job as I might have done and wondered if anybody else has done it properly. The Zope 3 project has zope.testing which has a very nice test runner (and isn't Zope-specific at all). You can get the code (via

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread John J Lee
On Fri, 5 May 2006, Benji York wrote: John J. Lee wrote: ...I wrote something to do this once, but didn't do as good a job as I might have done and wondered if anybody else has done it properly. The Zope 3 project has zope.testing which has a very nice test runner (and isn't

Re: easy way to dump a class instance?

2006-05-05 Thread Bruno Desthuilliers
Kamilche a écrit : Mark Harrison wrote: Is there a way to automatically print all the instance data in a class? print self.__dict__ Yeps - if you don't mind missing class attributes and data descriptors. -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread Benji York
John J Lee wrote: Is there a page that describes the Zope SVN layout? Not that I know of. It basically goes like this: if it's not a top-level project (like zope.testing), it's either in Zope (for Zope 2 stuff) or Zope3 (for Zope 3 stuff). -- Benji York --

Re: Python for Perl programmers

2006-05-05 Thread John J. Lee
[EMAIL PROTECTED] (Alex Martelli) writes: John J. Lee [EMAIL PROTECTED] wrote: A.M [EMAIL PROTECTED] writes: Is there any efficient online resource or book that help experienced Perl programmers to Python? Worry instead about how you're going to keep maintaining your Perl

Re: Is this a good use of __metaclass__?

2006-05-05 Thread Bruno Desthuilliers
Joel Hedlund a écrit : Hi! I need some input on my use of metaclasses since I'm not sure I'm using them in a pythonic and graceful manner. I'm very grateful for any tips, pointers and RTFMs I can get from you guys. Below, you'll find some background info and an executable code example.

Re: how to remove 50000 elements from a 100000 list?

2006-05-05 Thread Larry Bates
Peter Otten wrote: Ju Hui wrote: cool! thanks you all! I choose a=set(range(10)) b=set(range(5)) a.symmetric_difference(b) certainly,the real data not range(), I am satisfied the performance of set.difference thank you all again! Be warned that this may /add/ items to a:

Re: Tuple assignment and generators?

2006-05-05 Thread John J. Lee
vdrab [EMAIL PROTECTED] writes: [...] In fact, I think my code contains things like if len(arg) is 0: and so on, So you made a mistake. It's OK, you can forgive yourself, nobody will notice wink and I feel I should be able to do so given the way python treats (claims to treat?) constant

Re: Best IDE for Python?

2006-05-05 Thread BartlebyScrivener
Here's a shot of Komodo, albeit embedded in a pdf http://www.activestate.com/Products/Komodo/ActiveState_Komodo_datasheet.pdf -- http://mail.python.org/mailman/listinfo/python-list

print formate

2006-05-05 Thread Gary Wessle
Hi import string import re accumulator = [] pattern = '(\S*)\s*(\S*)\s*(\S*)' for each text file in dir openfile and read into text data = re.compile(pattern, re.IGNORECASE).findall(text) accumulator = accumulator + data gives a list of tuples which when printed looks like ('jack',

Re: NaN handling

2006-05-05 Thread Ivan Vinogradov
snip NaNs are handled. Throwing an exception would be nice in regular Python (non-scipy). This works to catch NaN on OSX and Linux: # assuming x is a number if x+1==x or x!=x: #x is NaN But is expensive as a precautionary measure. Assert can be used for testing, if production code

Re: HTMLParseError: EOF in middle of construct error

2006-05-05 Thread John J. Lee
Diez B. Roggisch [EMAIL PROTECTED] writes: [...] google:BeatifulSoup Even better, google for BeautifulSoup ^ John -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple assignment and generators?

2006-05-05 Thread Mel Wilson
vdrab wrote: I guess the take-away lesson is to steer clear from any reliance on object identity checks, if at all possible. Are there any other such optimizations one should like to know about? Object identity checks are just the thing/numero uno/ichiban for checking object identity. A

Re: to thine own SELF be true...

2006-05-05 Thread Paul Watson
Michael Ekstrand wrote: On Fri, May 05, 2006 at 05:08:24PM +, Mark Harrison wrote: Is there a way to get rid of those the self. references, or is this just something I need to get my brain to accept? It's pretty much just something you'll need to get your brain to accept. You can

Re: NaN handling

2006-05-05 Thread Grant Edwards
On 2006-05-05, Ivan Vinogradov [EMAIL PROTECTED] wrote: snip NaNs are handled. Throwing an exception would be nice in regular Python (non-scipy). That would break most of my Python programs (at least most of the ones in which I do floating point). My main problem with NaNs (and Infs) is

How to get client's IP address in the threaded case of SimpleXMLRPCServer?

2006-05-05 Thread Eirikur Hallgrimsson
Okay, I've banged my head against this for about three days on and off. The client's IP is passed to my handler in the non-threaded case. It's not in the threaded case, which is actually rather different with a couple of mixin classes mixing things up. I'm not confused, it's not passed. I

Re: print formate

2006-05-05 Thread Larry Bates
Gary Wessle wrote: Hi import string import re accumulator = [] pattern = '(\S*)\s*(\S*)\s*(\S*)' for each text file in dir openfile and read into text data = re.compile(pattern, re.IGNORECASE).findall(text) accumulator = accumulator + data gives a list of tuples which

Re: Using time.sleep() in 2 threads causes lockup when hyper-threading is enabled

2006-05-05 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], OlafMeding wrote: IIRC it was something like an NTP daemon that caused the clock to jump a little and (Window's) sleep was confused. The problem is not a jump but a permanet lockup of the sleep statement. The jump of the system clock might confuse the systems `sleep`

Re: ConfigParser and multiple option names

2006-05-05 Thread Ivan Vinogradov
Another option is to use a dedicated section and simply omit values for options: [dirs] /path/1: /long/path/2: /etc: Then get options for section dirs. This approach precludes using ':' or '=' in paths though. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using time.sleep() in 2 threads causes lockup when hyper-threading is enabled

2006-05-05 Thread Grant Edwards
On 2006-05-05, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], OlafMeding wrote: IIRC it was something like an NTP daemon that caused the clock to jump a little and (Window's) sleep was confused. The problem is not a jump but a permanet lockup of the sleep

Re: NaN handling

2006-05-05 Thread Ivan Vinogradov
snip There are those of us that need NaNs in production code, so it would have to be something that could be configured. I find that in my programs the places where I need to do something exceptional with a NaN are very limited. The vast majority of the time, I need them to propagate

How to get the target of a Windows shortcut file

2006-05-05 Thread Steve M
Below is some code adapted from something I think was written by Mark Hammond. Originally I needed to create a Windows shortcut (link), and this code does the trick, requiring only the target filename and the desired shortcut name. Now, I find I need to open a shortcut and extract the target

Re: NaN handling

2006-05-05 Thread Robert Kern
Ivan Vinogradov wrote: snip There are those of us that need NaNs in production code, so it would have to be something that could be configured. I find that in my programs the places where I need to do something exceptional with a NaN are very limited. The vast majority of the time, I need them

How to doctest if __name__ already used?

2006-05-05 Thread Leo Breebaart
I have a simple question (I hope), but one I'd love to get some feedback on in case I am missing something obvious: If I have a Python script that is executable, and therefore already uses '''if __name__ == __main__''' to call a function of its own, what is then the easiest yet still most

Re: NaN handling

2006-05-05 Thread Grant Edwards
On 2006-05-05, Ivan Vinogradov [EMAIL PROTECTED] wrote: snip There are those of us that need NaNs in production code, so it would have to be something that could be configured. I find that in my programs the places where I need to do something exceptional with a NaN are very limited. The

Re: NaN handling

2006-05-05 Thread Grant Edwards
On 2006-05-05, Robert Kern [EMAIL PROTECTED] wrote: Our programming expectations may differ, but an option to catch NaNs as an exception is a great idea. [...] Pure Python has a similar, but somewhat less flexible method, on UNIX platforms.

MakeBot - IDE for learning Python

2006-05-05 Thread Winston Wolff
I have just released a Windows and Macintosh OS X version of MakeBot, an IDE intended for students learning Python. It includes a very nice graphics/video game package based on PyGame. You can read all about it here: http://stratolab.com/misc/makebot/ -Winston --

Re: NaN handling

2006-05-05 Thread Robert Kern
Grant Edwards wrote: On 2006-05-05, Robert Kern [EMAIL PROTECTED] wrote: Pure Python has a similar, but somewhat less flexible method, on UNIX platforms. http://docs.python.org/dev/lib/module-fpectl.html For which Unix platforms? It's not there under Linux: Python 2.4.2 (#1, Feb 14

Re: Best IDE for Python?

2006-05-05 Thread Doug Bromley
On 5/5/06, Christoph Haas [EMAIL PROTECTED] wrote: On Fri, May 05, 2006 at 04:50:11PM +0100, Doug Bromley wrote: I have a Python IDE review I did a few months back you may want to view: http://www.straw-dogs.co.uk/blog/python-ide-review Sounds interesting. Could you fix the screenshots? I just get

Building Python (2.4.x) with Visual C++ 2005 Express Edition?

2006-05-05 Thread Heikki Toivonen
I did some searches but did not find any definitive answers as to whether or not it should be possible to build Python 2.4+ with Microsoft Visual C++ 2005 Express Edition. I tried it myself (have VC++ project files that work with Visual Studio 2003 .NET commercial version, just opened and closed

Re: NaN handling

2006-05-05 Thread Ivan Vinogradov
On 5-May-06, at 6:45 PM, Grant Edwards wrote: On 2006-05-05, Robert Kern [EMAIL PROTECTED] wrote: Our programming expectations may differ, but an option to catch NaNs as an exception is a great idea. [...] Pure Python has a similar, but somewhat less flexible method, on UNIX

Elegent solution to replacing ' and ?

2006-05-05 Thread fyleow
I'm trying to replace the ' and characters in the strings I get from feedparser so I can enter it in the database without getting errors. Here's what I have right now. self.title = entry.title.encode('utf-8') self.title = self.title.replace('\', '\\\') self.title = self.title.replace('\'',

Re: Elegent solution to replacing ' and ?

2006-05-05 Thread Jim
Are you sure that your dB interface module doesn't do this for you? What dB and interface are you using? Jim -- http://mail.python.org/mailman/listinfo/python-list

A critic of Guido's blog on Python's lambda

2006-05-05 Thread Xah Lee
Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's blog written in 2006-02-10 at http://www.artima.com/weblogs/viewpost.jsp?thread=147358 is first of all, the title “Language Design Is Not

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ben Finney
Xah Lee [EMAIL PROTECTED] writes: Python, Lambda, and Guido van Rossum Which one is the critic? Or is your subject field an indication that you continue not to learn from responses to your previous posts? is first of all, the title “Language Design Is Not Just Solving Puzzles”. In the

Re: How to get the target of a Windows shortcut file

2006-05-05 Thread Roger Upole
persist.Load('someshortcut.lnk') print sh.GetPath(shell.SLGP_RAWPATH)[0] hth Roger Steve M [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Below is some code adapted from something I think was written by Mark Hammond. Originally I needed to create a Windows shortcut (link),

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ken Tilton
Xah Lee wrote: Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's blog written in 2006-02-10 at http://www.artima.com/weblogs/viewpost.jsp?thread=147358 is first of all, the

Re: Replace

2006-05-05 Thread Ryan Forsythe
Eric wrote: I have a string... str = tyrtrbd =ffgtyuf == =tyryr =u=p ff I want to replace the characters after each '=', what I ended up doing is somthing like this... buf = list(str) newchr = '#' count = 0 for i in range(len(buf)): if buf[count] == '=': buf[count + 1]

how to construct a binary-tree using python?

2006-05-05 Thread hankssong
Hi everyone, I'm wondering whether it's possible to construct a binary-tree using python. Since python don't have pointer, it can't dynamically allocate memory like C language. But some important data structures like linked list, binary-tree and hash table are closely linked with dynamic memory

Re: how to construct a binary-tree using python?

2006-05-05 Thread Carl J. Van Arsdall
hankssong wrote: Hi everyone, I'm wondering whether it's possible to construct a binary-tree using python. Since python don't have pointer, it can't dynamically allocate memory like C language. But some important data structures like linked list, binary-tree and hash table are closely linked

Re: NaN handling

2006-05-05 Thread Robert Kern
Ivan Vinogradov wrote: It doesn't seem to be here under OSX either (universal Python install). It's not enabled by default. In the source distribution, it is Modules/fpectlmodule.c . Since numpy seems to be working on a variety of platforms/hardware, how hard would it be to extract this

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Alex Martelli
Ken Tilton [EMAIL PROTECTED] wrote: ... But the key in the whole thread is simply that indentation will not scale. Nor will Python. Absolutely. That's why firms who are interested in building *seriously* large scale systems, like my employer (and supplier of your free mail account), would

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread I V
On Fri, 05 May 2006 17:26:26 -0700, Xah Lee wrote: Regarding the lambda in Python situation... conceivably you are right that Python lambda is perhaps at best left as it is crippled, or even eliminated. However, this is what i want: I want Python literatures, and also in Wikipedia, to cease

Re: (question) How to use python get access to google search without query quota limit

2006-05-05 Thread Stephen Prinster
Per wrote: I am doing a Natural Language processing project for academic use, I think google's rich retrieval information and query-segment might be of help, I downloaded google api, but there is query limit(1000/day), How can I write python code to simulate the browser-like-activity to

Re: Active Directory Authentication

2006-05-05 Thread Roger Upole
If you have Pywin32 installed, you can use the win32com.adsi package to open an object with username/password credentials. See adsi.ADsOpenObject for details. Adsi also contains a number of interfaces for dealing with users, containers, etc. Roger D [EMAIL PROTECTED] wrote in message

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread David Hopwood
Ken Tilton wrote: [...] The upshot of what [Guido] wrote is that it would be really hard to make semantically meaningful indentation work with lambda. Haskell manages it. -- David Hopwood [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python kill a child process that keeps on running?

2006-05-05 Thread Roger Upole
Using Pywin32 (obviously not cross platform): import win32api,win32con h=win32api.OpenProcess(win32con.PROCESS_TERMINATE,False, pid) win32api.TerminateProcess(h, exit code) Roger I. Myself [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Suppose we spawn a child process with

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ken Tilton
Alex Martelli wrote: Ken Tilton [EMAIL PROTECTED] wrote: ... But the key in the whole thread is simply that indentation will not scale. Nor will Python. Absolutely. That's why firms who are interested in building *seriously* large scale systems, like my employer (and supplier of

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ken Tilton
David Hopwood wrote: Ken Tilton wrote: [...] The upshot of what [Guido] wrote is that it would be really hard to make semantically meaningful indentation work with lambda. Haskell manages it. To be honest, I was having a hard time imagining precisely how indentation broke down

Re: how to construct a binary-tree using python?

2006-05-05 Thread vdrab
Depending on what concrete use you have for binary trees, you may want to consider tuples. What's cool about them is that you get pattern matching on your tree for free. x = ((2,4),(5,6)) y, _ = x y (2, 4) (_,y), _ = x y 4 Or you could code your own binary tree class subclassing tuple. ...

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Jack Diederich
On Fri, May 05, 2006 at 05:26:26PM -0700, Xah Lee wrote: Python, Lambda, and Guido van Rossum [snip] Foxtrot Oscar Alpha Delta Others have said banning this troll would be wrong or undemocratic but let's be sane: he has wasted hundreds of hours of other people's time and hurt newbies especially

Weekly Python Patch/Bug Summary

2006-05-05 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 378 open ( +0) / 3216 closed (+17) / 3594 total (+17) Bugs: 894 open ( -7) / 5811 closed (+19) / 6705 total (+12) RFE : 216 open ( +2) / 215 closed ( +1) / 431 total ( +3) New / Reopened Patches __ Rename

Re: cross platform libraries

2006-05-05 Thread Ravi Teja
Not much to it. Just follow the SimpleXMLRPCServer example from Python docs and register your shutdown function. Call it using xmlrpclib remotely. Actually, I prefer the telnet method below. Simple and straight forward. -- http://mail.python.org/mailman/listinfo/python-list

Re: Elegent solution to replacing ' and ?

2006-05-05 Thread Serge Orlov
fyleow wrote: I'm trying to replace the ' and characters in the strings I get from feedparser so I can enter it in the database without getting errors. Here's what I have right now. self.title = entry.title.encode('utf-8') self.title = self.title.replace('\', '\\\') self.title =

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Steve R. Hastings
On Fri, 05 May 2006 21:16:50 -0400, Ken Tilton wrote: The upshot of what he wrote is that it would be really hard to make semantically meaningful indentation work with lambda. Pretty much correct. The complete thought was that it would be painful all out of proportion to the benefit. See,

<    1   2   3   >