Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-06 Thread gf gf
ening? Guido? PS And I don't mean waiting for Perl 6 to condense... --- Swaroop C H <[EMAIL PROTECTED]> wrote: > On Apr 6, 2005 8:23 AM, gf gf > <[EMAIL PROTECTED]> wrote: > > I've recently made the switch. Wow, is Python > great! > > One thing which I

Calling a Perl Module from Python

2005-04-05 Thread gf gf
I've recently made the switch. Wow, is Python great! One thing which I haven't been able to do is replace Perl's great lib collection (HTML::Parser, for instance, can do a lot that Soup just can't). Is there anyway to call Perl modules from Python? Thanks PS Please cc me on all responses

Python Debug logging

2005-03-15 Thread gf gf
Is there a simple way to log to a debug console in Python? In .NET, you can Debug.Write(str), which does nothing if there is no debug console open, but, if there is, debugs the message. Is there something similar? Alternatively, is there a very simple log4j type setup? I emphasize very simple,

Dumping an instance

2005-03-15 Thread gf gf
If I want to dump (for debugging) an instance and all of it's member attributes, what's the simplest way? print myInstance just gives a pointer to its location in memory Thanks! __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Ma

Why is lower() deprecated and how should I replace it?

2005-03-12 Thread gf gf
I read that lower() is deprecated. Unfortunately, I can't find the preferred way of lowercasing a string. What is it? Thanks PS Please cc me on all responses. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://small

Dictionaries of Lists

2005-03-07 Thread gf gf
I'd like to associate certain lists with keywords, and retrieve them. But this is not possible as lists are not hashable. What is the best workaround? I don't mind making my lists immutable. Is there a way to tupelize them? I tried mydict[mykey]=([a for a in list]) but it didn't seem to work.

Making things more functional in Python

2005-03-04 Thread gf gf
Is there a better, more FP style, more Pythonic way to write this: def compute_vectors(samples, dset): vectors = {} for d in dset: vectors[d] = [sample.get_val(d) for sample in samples] return vectors Namely, I'd like to get rid of the initilization (vector

Converting HTML to ASCII

2005-02-25 Thread gf gf
Hans, Thanks for the tip. I took a look at Beatiful Soup, and it looked like it was a framework to parse HTML. I'm not really interetsed in going through it tag by tag - just to get it converted to ASCII. How can I do this with B. Soup? --Thanks PS William - thanks for the reference to lynx,

Trace exceptions

2005-02-24 Thread gf gf
Is there anyway to do something like this: try: ... except Exception: print the Exception message (and maybe other info) __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail --

Flushing print()

2005-02-24 Thread gf gf
Is there any way to make Python's print() flush automatically, similar to...mmm...that other language's $|=1 ? If not, how can I flush it manually? sys.stdout.flush() didn't seem to work. __ Do you Yahoo!? Yahoo! Mail - now with 250MB free stor

Converting HTML to ASCII

2005-02-24 Thread gf gf
Hi. I'm looking for a Python lib to convert HTML to ASCII. Of course, a quick Google search showed several options (although, I must say, less than I would expect, considering how easy this is to do in *other* languages... :| ), but, I have 2 requirements, which none of them seem to meet: 1) Be