python library call equivalent to `which' command

2009-06-29 Thread destroooooy
Hi, I'm looking for a Python library function that provides the same functionality as the `which' command--namely, search the $PATH variable for a given string and see if it exists anywhere within. I currently examine the output from `which' itself, but I would like something more portable. I loo

conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-19 Thread destroooooy
I'm wondering what is the canonical usage of the keywords 'is' and 'not' when you're writing conditionals and loops. The one I've been following is completely arbitrary--I use the symbols '==', '!=' for numerical comparisons and the words 'is', 'not' for everything else. Thanks in advance! -- http

Re: string translate, replace, find and the forward slash

2008-04-29 Thread destroooooy
On Apr 29, 4:50 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > destroy <[EMAIL PROTECTED]> writes: > > Hi folks, > > I'm finding some (what I consider) curious behavior with the string > > methods and the forward slash character. I'm writing

Re: string translate, replace, find and the forward slash

2008-04-29 Thread destroooooy
On Apr 29, 4:50 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > destroy <[EMAIL PROTECTED]> writes: > > Hi folks, > > I'm finding some (what I consider) curious behavior with the string > > methods and the forward slash character. I'm writing

string translate, replace, find and the forward slash

2008-04-29 Thread destroooooy
Hi folks, I'm finding some (what I consider) curious behavior with the string methods and the forward slash character. I'm writing a program to rename mp3 files based on their id3 tags, and I want to protect against goofy characters in the in tags. So I do the following: unsafe_chars = "/#()[EMA