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

Patrick K. O'Brien pobrien@orbtech.com
Sat, 9 Jun 2001 09:30:19 -0500


That does help. I'm just so in love with Python's approach of having
OneRightWay for everything that I'm trying to apply that to my own code. At
every step I'm wondering, what is the OneRightWay for this? (Yes, I have
been accused of being a bit anal.) If anyone else has a better OneRightWay
to organize code I'm all ears. <grin>

---
Patrick K. O'Brien
Orbtech
"I am, therefore I think."

-----Original Message-----
From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
Daniel Yoo
Sent: Saturday, June 09, 2001 2:48 AM
To: Patrick K. O'Brien
Cc: Python Tutor
Subject: RE: [Tutor] Utility functions - was: Best way to strip string
string padded with nulls

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!


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor