Dump interpreter history?

2011-03-25 Thread Ken D'Ambrosio
Hey, all. A co-worker asked me a question, and I've got no idea how (or if) it can be done. Bottom line: he'd like to save off the text from an interpreter session, his thinking being that you've already tried to get what you want, and now you just need to gussy it up in an editor. Can this be

Regex in if statement.

2011-03-20 Thread Ken D'Ambrosio
Hey, all -- I know how to match and return stuff from a regex, but I'd like to do an if, something like (from Perl, sorry): if (/MatchTextHere/){DoSomething();} How do I accomplish this in Python? Thanks! -Ken -- http://mail.python.org/mailman/listinfo/python-list

N00b question: matching stuff with variables.

2010-06-28 Thread Ken D'Ambrosio
Hi, all. I've got a file which, in turn, contains a couple thousand filenames. I'm writing a web front-end, and I want to return all the filenames that match a user-input value. In Perl, this would be something like, if (/$value/){print $_ matches\n;} But trying to put a variable into regex

Unbuffered keyboard input?

2009-06-09 Thread Ken D'Ambrosio
I need to have some non-buffered keyboard interaction with a Python script (on Linux). Back in the day, I fired up Curses to do this in Perl. Any idea if that's still how I have to fly? Or is there a different mechanism? Thanks! -Ken -- This message has been scanned for viruses and

Mail client in Python?

2009-03-23 Thread Ken D'Ambrosio
Idle curiosity: is there a (decent) IMAP mail client (web or local) written in Python? I've got a project that needs doing, and it just occurred to me that a mail client might be the ideal interface; I'd have to change some back-end stuff (to do database queries instead of IMAP or POP queries),

Regular Expressions...

2009-01-07 Thread Ken D'Ambrosio
Hi, all. As a recovering Perl guy, I have to admit I don't quite get the re module. For example, I'd like to do a few things (I'm going to use phone numbers, 'cause that's what I'm currently dealing with): 12345678900 -- How would I: - Get just the area code? - Get just the seven-digit number?

Regular Expressions...

2009-01-07 Thread Ken D'Ambrosio
Hi, all. As a recovering Perl guy, I have to admit I don't quite get the re module. For example, I'd like to do a few things (I'm going to use phone numbers, 'cause that's what I'm currently dealing with): 12345678900 -- How would I: - Get just the area code? - Get just the seven-digit number?

Detaching e-mail attachments?

2008-12-06 Thread Ken D'Ambrosio
Hi, all. I've done some poking around, and can find roughly two million different ways to attach attachments to an e-mail... but darn few to detach them. Any suggestions? I'm assuming I'm just missing looking in The Right Place, but thus-far, my Googling has been for naught. Thanks! -Ken --

Good introductory book?

2008-12-03 Thread Ken D'Ambrosio
Hi, all. I'm getting ready to do some projects in Python, and I've cut my teeth a little bit, but I've found the Learning|Programming Python books from O'Reilly to be more-or-less useless (to my surprise -- I'm usually an O'Reilly fan). I really, really like Python Essential Reference, but it's

OOP books?

2008-10-15 Thread Ken D'Ambrosio
Hi, all. Over the years, I've programmed in a fair number of languages; the ones with which I became most familiar were assembler, BASIC, Pascal, and lately (the last fifteen years or so) Perl. Now I'm trying my hand at Python. While I don't have any problems with the ins and outs of the

Newbie question...

2008-09-29 Thread Ken D'Ambrosio
First, apologies for such a newbie question; if there's a better forum (I've poked around, some) feel free to point it out to me. Anyway, a mere 25-odd years after first hearing about OOP, I've finally decided to go to it, by way of Python. But this puzzles me: import commands free =