[Tutor] Utility functions - was: Best way to strip string string padded with nulls

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Sat, 9 Jun 2001 00:47:57 -0700 (PDT)


On Wed, 6 Jun 2001, Patrick K. O'Brien wrote:

> I think my question might not have been clear enough. I was wondering where
> to put these functions on my local machine. For example, should I create a
> file like utility.py and import that file into my other programs so I can
> make use of these little utility functions, like my stripnull()? Does that
> make sense? What do the rest of you do?

I often keep a small personal directory filled with useful scripts that
I've written.  If a function seems a bit obscure, it goes into its own
little file.  Who knows --- a unoverlapping-genome-sequence-displayer.py
might come in handy someday.  *grin*

If it seems general enough, it'll go into a file that's more generically
named.  For example, I put some of my string manipulating functions in a
file called "MyStringUtils.py".  You can probably make it more personal by
putting your initials in the name somewhere... although I haven't done
this myself, since "MyDy.py" looks a little silly.


Finally, to make things nicer, I set my PYTHONPATH up so that those
scripts are available at my fingertips.

Hope this helps!