Re: empty classes as c structs?

2005-02-04 Thread Alan McIntyre
Christopher, I've found myself doing the same thing. You could do something like this: blah = type('Struct', (), {})() blah.some_field = x I think I'd only do this if I needed to construct objects at runtime based on information that I don't have at compile time, since the two lines of code for

Re: string issue

2005-02-04 Thread Alan McIntyre
'] ips_new = [] for ip in ips: if '255' not in ip: ips_new.append(ip) print ips_new Or this: ips_new = [ip for ip in ips if '255' not in ip] print ips_new Hope this helps, Alan McIntyre http://www.esrgtech.com rbt wrote: Either I'm crazy and I'm missi

Re: string issue

2005-02-04 Thread Alan McIntyre
Wow, that's cool; I'd never seen that before. :) Thanks, Steve.. Steve Holden wrote: You are modifying the list as you iterate over it. Instead, iterate over a copy by using: for ip in ips[:]: ... regards Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: "Collapsing" a list into a list of changes

2005-02-05 Thread Alan McIntyre
Steve, Yeah, in this particular application the ordering and reoccurrence of a value in a non-contiguous way does matter; if those two things weren't required I think the method you suggested would be a good way to remove the duplicates. Thanks! Coates, Steve (ACHE) wrote: It's not _exactly_ wh

Re: "Collapsing" a list into a list of changes

2005-02-05 Thread Alan McIntyre
occurrences of groups of the same item. If I didn't need those two qualities of the list to be preserved, though, I think I'd use something like your solution (if I was using a Python older than 2.3) or Steve Coats' solution posted above using Set. Thanks! Alan Tony wrote: Here is

Re: "Collapsing" a list into a list of changes

2005-02-05 Thread Alan McIntyre
Alex, Wow, that method turns out to be the fastest so far in a simple benchmark on Python2.3 (on my machine, of course, YMMV); it takes 14% less time than the one that I deemed most straightforward. :) Thanks, Alan Alex Martelli wrote: H, what role does the enumeration play here? I don&#

Re: Trouble converting hex to decimal?

2005-02-05 Thread Alan McIntyre
mple: >>> struct.unpack('f', '\x00\x00(B') (42.0,) Hope this helps, Alan Earl Eiland wrote: I'm trying to process the IP packet length field, as recorded by pcap (Ethereal) and recovered using pcapy. When I slice out those bytes, I get a value that shows in '\

Re: noob question

2005-06-27 Thread Alan Gauld
riables aren't typed anyway. So I am curious as to why anyone would feel the need to introduce these kinds of notational features into Python. What is the problem that you are trying to solve? -- Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: Life of Python

2005-06-27 Thread Alan Gauld
re! I certainly didn't find us rewriting Lisp code rather than enhancing what was there, and Lisp shares much of Python's approach to life. -- Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Alan Kennedy
n cinema. get-orff-moy-lahnd-ly y'rs -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] How to get 4 numbers from the user in one line for easycomparision?

2005-07-03 Thread Alan G
7;Type 4 numbers separated by spaces: ') numbers = [int(n) for n in line.split(' ')] HTH, Alan G. -- http://mail.python.org/mailman/listinfo/python-list

Make a .WAV file come out of the left speaker in Windows

2005-07-11 Thread Alan Green
ns as to where to start with these two? Does anybody have other solutions to suggest? Alan. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing last comma in 'C1, C2, C3' with 'and' so that it reads'C1, C2 and C3'

2005-07-12 Thread Alan Green
Ric Da Force wrote: > Hi guys, > > Thank you all for your input! It was good to see so much convergence in the > approach! Just for divergence, you can also do this with regular expressions: >>> import re >>> re.sub("(.*),(.*)", r"\1 and\2&quo

Re: Searching through a list of tuples

2005-07-12 Thread Alan Green
... > >>> items.index(Key(lambda x: x[2] == 20)) > 1 Neat solution. I'd add an extra kind of Key, since finding tuples where a given position is equal to a given value seems to be the common case: >>> class EqualKey(Key): ... def __init__(self, pos, val): ...

Re: Java RMI-like services in Python

2005-07-18 Thread Alan Kennedy
ion? B: Use one that's already been written? If the answer is the latter, I recommend you take a look at PyLinda. PyLinda - Distributed Computing Made Easy http://www-users.cs.york.ac.uk/~aw/pylinda/ -- alan kennedy ------ email

Re: Make a .WAV file come out of the left speaker in Windows

2005-07-18 Thread Alan Green
Alan Green wrote: > I am writing a Python script that uses the win32all winsound package to > play a .wav file. I [need] the sound come out of the left hand speaker, but > not the right hand speaker. I eventually got out ctypes and used it to access the Windows multi-media libraries.

Re: Counting processors

2005-07-25 Thread Alan Kennedy
/basic/hwbapy01.mspx -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: JBUS and Python which way

2005-08-03 Thread Alan Kennedy
How to talk between the PC and the JBus instrument-manager" rather than "How to talk between the PC and JBus instruments". Depending on the protocol used by the "instrument-manager", you may be able to use python to control that. HTH, -- alan kennedy -

Re: Put a url in a browsers address bar

2005-08-18 Thread Alan Kemp
b = openBrowser() > b.goToUrl(url) > return True > def goToGoogle(): import webbrowser webbrowser.open("www.google.com"); Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: (OT) Is there something that people can use instead of full blown Python to run Python programs?

2005-08-18 Thread Alan Kemp
http://starship.python.net/crew/theller/py2exe/ to convert into a native executable. Of course this depends on whether your question was intended as "how can people run some python script", or "how can people run my python script". Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: global interpreter lock

2005-08-20 Thread Alan Kennedy
-is-in-the-eye-of-the-beholder-ly y'rs -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: global interpreter lock

2005-08-20 Thread Alan Kennedy
grad thesis in 1988, but when I realised the complexity of the problem, I picked a hypertext project instead ;-) http://en.wikipedia.org/wiki/Occam_programming_language IMHO, python generators (which BTW are implemented with a JVM goto instruction in jython 2.2) are a ni

Re: last line chopped from input file

2005-08-21 Thread Alan Kemp
t.txt") > > My error message is: > AttributeError: 'module' object has no attribute 'command' > > I also could not find os.command in the help files. My Python version > is 2.4 (latest is 2.4.1, just a bug-fix release). > I imagine thats was a t

Re: Sanitizing untrusted code for eval()

2005-08-23 Thread Alan Kennedy
p JSON strings, which means that you cannot be strict about things like double (") vs. single (') quotes, etc. JSON is so simple, I think it best to write a tokeniser and parser for it, either using a parsing library, or just coding your own. -- alan kennedy --

Re: Jargons of Info Tech industry

2005-08-29 Thread Alan Balmer
Why on earth was this cross-posted to comp.lang.c.? Followups set. On Mon, 29 Aug 2005 12:26:11 GMT, [EMAIL PROTECTED] wrote: >In comp.lang.perl.misc Mike Meyer <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] writes: >>> In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: Chris Head

Re: Jargons of Info Tech industry

2005-08-29 Thread Alan Balmer
On Fri, 26 Aug 2005 16:47:10 GMT, Chris Head <[EMAIL PROTECTED]> wrote: >This point I agree with. There are some situations - 'net cafes included >- - where thick e-mail clients don't work. Even so, see below. I use Portable Thunderbird, on a USB memory stick. All I need is a USB port and an inte

Re: python xml DOM? pulldom? SAX?

2005-08-29 Thread Alan Kennedy
"revision_text\t%s" % new_page.revision_text print if __name__ == "__main__": parser = xml.sax.make_parser() parser.setContentHandler(page_matcher(page_handler)) parser.setFeature(xml.sax.handler.feature_namespaces, 0) parser.feed(testdoc) #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: python xml DOM? pulldom? SAX?

2005-08-29 Thread Alan Kennedy
[Alan Kennedy] >>SAX is perfect for the job. See code below. [Fredrik Lundh] > depends on your definition of perfect... Obviously, perfect is the eye of the beholder ;-) [Fredrik Lundh] > using a 20 MB version of jog's sample, and having replaced > the print statements

Re: Jargons of Info Tech industry

2005-08-29 Thread Alan Balmer
On 29 Aug 2005 21:12:13 GMT, John Bokma <[EMAIL PROTECTED]> wrote: >> Now, go away. And please, stay away. > >Like I already said, it doesn't work that way. Goodbye, John. Filters set. -- Al Balmer Balmer Consulting [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-08-30 Thread Alan Kennedy
he review, and the "Python Powered" logo is right there for all to see). Congratulations! Unfortunately, PCW don't seem to have made the review available online (yet), so I can't provide a URL. Maybe someone else will have more success finding a URL? thought-ye'd-like-to-know-ly'

Re: Jargons of Info Tech industry

2005-08-30 Thread Alan Balmer
On Tue, 30 Aug 2005 11:30:19 GMT, [EMAIL PROTECTED] wrote: >In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: >> Alan Balmer <[EMAIL PROTECTED]> wrote: > >>> On 29 Aug 2005 21:12:13 GMT, John Bokma <[EMAIL PROTECTED]> wrote: > >>>&

Re: SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-08-31 Thread Alan Kennedy
[Alan Kennedy] >> (PCW, for those who don't know it, is sort of the UK's equivalent >> of Byte Magazine,except that it's still publishing after almost 25 >> years). [Paul Boddie] > Hmmm. Even Byte at its lowest point was far better than PCW ever was. Wel

Re: SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-09-01 Thread Alan Kennedy
[Alan Kennedy] >> ... PCW ran a story this time last year >> about Michael Sparks, python and python's use in the BBC's future >> distribution plans for digital TV. [Paul Boddie] > Well, I didn't even notice the story! ;-) Here's the message I posted h

Re: SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-09-01 Thread Alan Kennedy
[Alan Kennedy] >>IMHO, there is a great opportunity here for the python community: > > [...] > >>Surely that's worth a simple team name, for mnemonic purposes >>if nothing else. Something different or unusual, like one of my >>favourites, "Legion of

Re: OpenSource documentation problems

2005-09-01 Thread Alan Balmer
On 1 Sep 2005 03:51:55 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: >On Python's Documentation Thinking about it, I can't imagine why I've waited so long to filter this idiot. -- Al Balmer Balmer Consulting [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: dual processor

2005-09-05 Thread Alan Kennedy
llection. Read this thread to see what Matz has to say about threading in Ruby. http://groups.google.com/group/comp.lang.ruby/msg/dcf5ca374e6c5da8 One of these years I'm going to have to set aside a month or two to go through and understand the cpython interpreter code, so that I

Re: Python xml.dom, help reading attribute data

2005-09-06 Thread Alan Kennedy
sourceforge.net Xpath tutorials from here http://www.zvon.org/xxl/XPathTutorial/General/examples.html http://www.w3schools.com/xpath/ there-are-other-ways-to-do-it-but-i-like-xpath-ly'yrs, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Django Vs Rails

2005-09-06 Thread Alan Kennedy
still aren't 100% stable. http://www.djangoproject.com/screencasts/model_syntax_change/ -- alan kennedy ------ email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Search Engine app

2005-09-14 Thread Alan Meyer
nes I've written for custom projects - in C or PL/1, it has been necessary to perform very high speed operations on highly compressed binary structures - which is not Python's forte. You might be able to put a Python interface over an engine written in another language. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Search Engine app

2005-09-14 Thread Alan Meyer
"Alan Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ... > I stand ready to be corrected, but I think Python would not be a > good language for writing search engines. In the ones I've written > for custom projects - in C or PL/1, it has been ne

Ann: New SQL topic in Tutorial

2005-09-19 Thread Alan Gauld
k/hp/alan.gauld/tutdbms.htm As in the rest of my tutorial it's aimed at those with no experience in databases and limited Python experience (basically the earlier bit of my tutor!). It attempts to teach enough to make other more complete tutorials accessible. Hopefully it will be useful --

Re: Python and Unix Commands

2005-09-19 Thread Alan Gauld
a way around this?? If you must do this then I'd suggest you need to launch a separate thread per shell then use commands/subprocess to launch each interpreter/script invocation from within its own thread. [ If you are not interested in the results you could just use the Unix '&'

Re: "Collapsing" a list into a list of changes

2005-02-06 Thread Alan McIntyre
Thanks to everybody that responded; I appreciate all the input, even if I didn't respond to all of it individually. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda

2005-02-08 Thread Alan McIntyre
Hope this helps, Alan McIntyre ESRG LLC http://www.esrgtech.com -- http://mail.python.org/mailman/listinfo/python-list

Re: multi threading in multi processor (computer)

2005-02-09 Thread Alan Kennedy
"tuple space", where objects live. The objects can be located and sent messages. But (Py)Linda hides most of gory details of how objects actually get distributed, and the mechanics of actually connecting with those remote objects. http://www-users.cs.york.ac.uk/~aw

Re: goto, cls, wait commands

2005-02-10 Thread Alan Kennedy
? If I remeber correctly I used to type "Wait 10" and QBasic waits 10 seconds before proceeding to next command. Ahh, a simple question! :-) import time time.sleep(10.0) HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a safe marshaler?

2005-02-10 Thread Alan Kennedy
gards, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a safe marshaler?

2005-02-10 Thread Alan Kennedy
[Alan Kennedy] What I find particularly intriguing is the JSON-RPC protocol, which looks like a nice lightweight alternative to XML-RPC. http://oss.metaparadigm.com/jsonrpc/ Also interesting is the browser embeddable JSON-RPC client written in javascript, for which you can see a demo here http

Re: is there a safe marshaler?

2005-02-10 Thread Alan Kennedy
[Irmen de Jong] >>> I need a fast and safe (secure) marshaler. [Alan Kennedy] >> , would something JSON be suitable for your need? >> >> http://json.org [Irmen de Jong] > Looks very interesting indeed, but in what way would this be > more secure than say, pickl

Re: Python and version control

2005-02-10 Thread Alan Kennedy
uperb tools. -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and version control

2005-02-10 Thread Alan Kennedy
acronym right?-) It seems that VSS provides viRTual source-safety... In my circles, VSS is most often referred to as Visual Source Unsafe. -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a safe marshaler?

2005-02-10 Thread Alan Kennedy
[Alan Kennedy] >> Well, the python JSON codec provided appears to use eval, which might >> make it *seem* unsecure. >> >> http://www.json-rpc.org/pyjsonrpc/index.xhtml >> >> But a more detailed examination of the code indicates, to this reader >> at le

Re: listerator clonage

2005-02-12 Thread Alan McIntyre
d think of. Hope this helps, Alan McIntyre ESRG LLC http://www.esrgtech.com Cyril BAZIN wrote: Hello, I want to build a function which return values which appear two or more times in a list: So, I decided to write a little example which doesn't work: #l = [1, 7, 3, 4, 3, 2, 1] #i = iter(l) #for

Re: is there a safe marshaler?

2005-02-12 Thread Alan Kennedy
nds promising! Well, I'm always dubious of OSS projects that don't even have any bugs reported, let alone fixed: no patches submitted, etc, etc. http://sourceforge.net/tracker/?group_id=82591 Though maybe I'm missing something obvious? -- alan kennedy --

Re: For American numbers

2005-02-13 Thread Alan Kennedy
4 and "mega" is 1024*1024 and so forth... Maybe you missed these? http://en.wikipedia.org/wiki/Kibibyte http://en.wikipedia.org/wiki/Mebibyte http://en.wikipedia.org/wiki/Gibibyte kilo-mega-giga-etc-should-be-powers-of-10-ly y'rs, -- alan kennedy --

Re: changing __call__ on demand

2005-02-13 Thread Alan McIntyre
I tried this: >>>class test(object): ... def __call1(self): ... print 1 ... __call__ = __call1 ... >>>t = test() >>>t() 1 >>> Is that what you were looking for? -- Alan McIntyre ESRG LLC http://www.esrgtech.com Stefan Behnel wrote: Hi! This

Re: connecting to Sybase/MsSQL from python

2005-02-13 Thread Alan Kennedy
questions being asked a *second* time without some form of reasonable answer . As already mentioned by another poster, have you considered using ODBC? There are several python ODBC implementations. HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Second posting - Howto connect to MsSQL

2005-02-13 Thread Alan Kennedy
[John Fabiani] > Since this is (sort of) my second request it must not be an easy > solution. Are there others using Python to connect MsSQL? [jdonnell] http://sourceforge.net/projects/mysql-python Note that "MsSQL" != "My

Re: changing __call__ on demand

2005-02-13 Thread Alan McIntyre
Thanks; I didn't read close enough. :) -- Alan McIntyre ESRG LLC http://www.esrgtech.com Michael Hoffman wrote: Alan McIntyre wrote: >>>class test(object): ...def __call1(self): ...print 1 ...__call__ = __call1 Is that what you were looking for? That still only allo

Re: How to implement a file lock ??

2005-02-15 Thread Alan Kennedy
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203 HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing IMAP responses?

2005-02-15 Thread Alan Kennedy
t . It's no wonder the spammers can ply their trade with such ease. grumpily-y'rs, -- alan kennedy ------ email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Canonical way of dealing with null-separated lines?

2005-02-23 Thread Douglas Alan
Is there a canonical way of iterating over the lines of a file that are null-separated rather than newline-separated? Sure, I can implement my own iterator using read() and split(), etc., but considering that using "find -print0" is so common, it seems like there should be a more cannonical way.

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Douglas Alan
Christopher De Vries <[EMAIL PROTECTED]> writes: > I'm not sure if there is a canonical method, but I would > recommending using a generator to get something like this, where 'f' > is a file object: Thanks for the generator. It returns an extra blank line at the end when used with "find -print0"

Re: Canonical way of dealing with null-separated lines?

2005-02-25 Thread Douglas Alan
Okay, here's the definitive version (or so say I). Some good doobie please make sure it makes its way into the standard library: def fileLineIter(inputFile, newline='\n', leaveNewline=False, readSize=8192): """Like the normal file iter but you can set what string indicates newline. You can

Re: Canonical way of dealing with null-separated lines?

2005-02-26 Thread Douglas Alan
I wrote: > Okay, here's the definitive version (or so say I). Some good doobie > please make sure it makes its way into the standard library: Oops, I just realized that my previously definitive version did not handle multi-character newlines. So here is a new definition version. Oog, now my br

lambda strangeness??

2005-02-27 Thread Alan Gauld
different answers I'm getting? FWIW the behaviour I expected was what seems to happen inside the for loop... It seems to somehow be related to the last value in the range(), am I somehow picking that up as y? If so why? Or is that just a coincidence? And why did it work inside the for loop?

Re: lambda strangeness??

2005-02-27 Thread Alan Gauld
On Sun, 27 Feb 2005 09:07:28 + (UTC), Alan Gauld <[EMAIL PROTECTED]> wrote: > >>> adds = [lambda y: (y + n) for n in range(10)] > >>> adds[0](0) > 9 > >>> for n in range(5): print adds[n](42) > ... > 42 > 43 > the for loop... It seem

Re: lambda strangeness??

2005-02-28 Thread Alan Gauld
ion. I just forgot the default argument trick! And then confused myself by coincidentally using n both inside and outside the LC, thus apparently getting inconsistent results! Thanks again, Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question

2005-02-28 Thread Alan Gauld
t into either a Canvas or a Text widget. > Any help or sample code would be much appreciated. If you find the file hmgui.zip on Useless Python you will find the code for my games framework with an example Hangman game in Tkinter. It includes the display of a set of images(the hanged man) HTH

yield_all needed in Python

2005-02-28 Thread Douglas Alan
While writing a generator, I was just thinking how Python needs a "yield_all" statement. With the help of Google, I found a pre-existing discussion on this from a while back in the Lightweight Languages mailing list. I'll repost it here in order to improve the chances of this enhancement actually

Re: Canonical way of dealing with null-separated lines?

2005-02-28 Thread Douglas Alan
I wrote: > Oops, I just realized that my previously definitive version did not > handle multi-character newlines. So here is a new definitive > version. Oog, now my brain hurts: I dunno what I was thinking. That version sucked! Here's a version that's actually comprehensible, a fraction of th

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Andrew Dalke <[EMAIL PROTECTED]> writes: > On Mon, 28 Feb 2005 18:25:51 -0500, Douglas Alan wrote: >> While writing a generator, I was just thinking how Python needs a >> "yield_all" statement. With the help of Google, I found a >> pre-existing discus

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Cetainly, if iterator> == , I don't see how anything > is gained except for a few keystrokes. What's gained is making one's code more readable and maintainable, which is the one of the primary reasons that I use Python. |>oug -- http://mail.python.or

Re: Canonical way of dealing with null-separated lines?

2005-03-01 Thread Douglas Alan
"John Machin" <[EMAIL PROTECTED]> writes: >>lines = (partialLine + charsJustRead).split(newline) > The above line is prepending a short string to what will typically be a > whole buffer full. There's gotta be a better way to do it. If there is, I'm all ears. In a previous post I provide

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Duncan Booth <[EMAIL PROTECTED]> writes: > Douglas Alan wrote: >> "Terry Reedy" <[EMAIL PROTECTED]> writes: >>> Cetainly, if >> iterator> == , I don't see how anything >>> is gained except for a few keystrokes. >> What'

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Francis Girard <[EMAIL PROTECTED]> writes: > Therefore, the suggestion you make, or something similar, would have > actually ease my learning, at least for me. Yes, I agree 100%. Not having something like "yield_all" hurt my ability to learn to use Python's generators quickly because I figured t

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
David Eppstein <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Douglas Alan <[EMAIL PROTECTED]> wrote: >> > Cetainly, if > > iterator> == , I don't see how anything >> > is gained except for a few keystrokes. >> Wha

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Steve Holden <[EMAIL PROTECTED]> writes: > Guido has generally observed a parsimony about the introduction of > features such as the one you suggest into Python, and in particular > he is reluctant to add new keywords - even in cases like decorators > that cried out for a keyword rather than the u

Re: Canonical way of dealing with null-separated lines?

2005-03-01 Thread Douglas Alan
"John Machin" <[EMAIL PROTECTED]> writes: >> In Python, >>longString + "" is longString >> evaluates to True. I don't know how you can do nothing more >> gracefully than that. > And also "" + longString is longString > The string + operator provides those graceful *external* results by >

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Steven Bethard <[EMAIL PROTECTED]> writes: > I'm guessing the * syntax is pretty unlikely to win Guido's > approval. There have been a number of requests[1][2][3] for syntax > like: > x, y, *rest = iterable Oh, it is so wrong that Guido objects to the above. Python needs fully destructurin

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Isaac To <[EMAIL PROTECTED]> writes: >> "Isaac" == Isaac To <[EMAIL PROTECTED]> writes: > > def gen_all(gen): > for e in gen: > yield e > > def foogen(arg1): > def foogen1(arg2): > # Some code here > # Some code here > gen_all(arg3) > ^ I mean foogen

Re: yield_all needed in Python

2005-03-02 Thread Douglas Alan
Nick Coghlan <[EMAIL PROTECTED]> writes: > If you do write a PEP, try to get genexp syntax supported by the > yield keyword. > That is, the following currently triggers a syntax error: >def f(): > yield x for x in gen1(arg) Wouldn't yield *(x for x in gen1(arg)) be sufficient, and

Subscription donations to PSF

2005-03-02 Thread Alan McIntyre
e in the newsgroup or otherwise communicate this interest to the PSF so they have a feel for how many people would take advantage of the donation option if they offered it. For those not familiar with the PSF, plenty of info can be found here: http://python.org/psf/ Thanks! Alan McIntyre

Re: windows bat file question

2005-03-04 Thread Alan Gauld
cond only to Perl programming. And using WSH is so much easier, even JavaScript and VBScript are pleasant compared to CMD language... And of course Python can be used if appropriately installed, but then you'd probably just use Python! Alan G. Author of the Learn to Program website htt

Re: survey

2005-03-04 Thread Alan Gauld
e them for different jobs. Vive la difference... Oh yes, and don't forget to include Lisp/Scheme/Guile in your considerations... :-) Alan G Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python on PowerMac?

2004-11-29 Thread Alan Kennedy
rceforge.net running-to-find-my-flame-retardant-suit-ly'yrs -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Automated mail bounce handling.

2004-12-03 Thread Alan Kennedy
. I am trying to think of more robust and less costly (in coding time) approaches. Maybe some form of text-matching algorithm, such as 1. Bayesian classification? 2. Keyword recognition? I'd be grateful for any pointers or suggestions

Re: Difficulties POSTing to RDP Hierarchy Browse Page

2004-12-03 Thread Alan Kennedy
e", "gt1200"), ("taxonomy", "rdpHome"), ("browse", "Browse"),] > > params = urllib.urlencode(options) > > rdpbrowsepage = urllib.urlopen( > "http://rdp.cme.msu.edu/hierarchy/HierarchyControllerServlet/start";, > params) > > pagehtml = rdpbrowsepage.read() > > print pagehtml > -end Python test code-- HTH, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: teaching OO

2004-12-06 Thread Alan Gauld
d be like an Electronics professor spending a lecture dismantling an oscilloscope and discussing the circuit diagram - mildy interesting, but ultimately pointless! Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: Webapp servers & security

2004-12-07 Thread Alan Kennedy
/doc-html/dir-handlers.html 4: http://www.mems-exchange.org/software/scgi/ 5: http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html > Did I miss anything? I am sure there are other approaches as well. HTH, -- alan kennedy ------ email alan:

Re: Persistent objects

2004-12-12 Thread Alan Kennedy
l in all, a great little package. I recommend that you take a close look. Regards, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: lies about OOP

2004-12-14 Thread Alan Morgan
der some circumstances. IMHO, "loves perl" doesn't mesh with either "old school" or "cares about overhead", but that's just me. Alan -- Defendit numerus -- http://mail.python.org/mailman/listinfo/python-list

xmlrpclib with technorati

2004-12-15 Thread Alan Little
I'm trying to write a generic weblog update notifier using xmlrpclib, starting with technorati. What I want to do is something like this : XML config file that would look like this: http://mail.python.org/mailman/listinfo/python-list

Re: BASIC vs Python

2004-12-18 Thread Alan Gauld
.. If C can do it I'm sure it must be feasible in python! Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: BASIC vs Python

2004-12-19 Thread Alan Gauld
gory here. Can debug, if not produce code > from scratch: COBOL, Fortran, BASIC > > Have toyed with? Smalltalk, Haskell, Prolog, Snoball, 68xxx assembler, Scheme, Occam, vim macros, Objective C > > Want to forget? COBOL, Occam, Robot, DOS batch, RatFor, vim macros Al

Re: Language fluency (was Re: BASIC vs Python)

2004-12-20 Thread Alan Gauld
training course for C++ that I realized I'd forgotten how to do string handling in C - we only had LEDs for I/O...! :-) Alan G. Author of the Learn to Program website http://www.freenetpages.co.uk/hp/alan.gauld -- http://mail.python.org/mailman/listinfo/python-list

Re: BASIC vs Python

2004-12-20 Thread Alan Gauld
h in their Sparc workstations. Their system prompt is really a Forth interpreter... I don;t know where the interpreter resides, presumably not in Sparc since its a RISC but interesting that they still use it. (Or they did last time I used a Sparc - 4 years ago?) Alan G. Author of the Learn to Program w

Re: Web forum (made by python)

2004-12-20 Thread Alan Kennedy
hink we've had any trolls in the NG lately, although perhaps one or two people have been *extremely* grumpy ;-) pining-for-the-tropics-ly y'rs, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

Re: type method-wrapper?

2004-12-20 Thread Alan Kennedy
[-4:] == 'Type' and isinstance(l.__delattr__, getattr(types, t)): ... print "It's a '%s'" % str(t) ... It's a 'ObjectType' >>> I also am interested in what is. regards, -- alan kennedy -- email alan: http://xhaus.com/contact/alan -- http://mail.python.org/mailman/listinfo/python-list

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

2004-12-21 Thread Alan Kennedy
s suitably impressed. Well, things are getting better then . It used to be that grandiose manifestos and suitably impressive plans were all you needed to make billions through a stock flotation ;-) <0.5 wink>-ly y'rs, -- alan kennedy

<    1   2   3   4   5   6   7   8   9   10   >