Couple functions I need, assuming they exist?
Peter Hansen
peter at engcorp.com
Mon Jun 20 11:27:30 EDT 2005
Charles Krug wrote:
> First, I'm reading that aString.split() is depreciated. What's the
> current best practice for this?
>
> Or am I mistaking that:
>
> myWords = split(aString, aChar)
> is depreciated but
If you mean "import string; string.split(aString, aChar)" then
yes, it's deprecated (not "depreciated", by the way).
> myWords = aString.split(aChgar)
> is not?
Correct, this is perfectly acceptable.
> Second question, I've written a script that generates a LaTeX source
> containing randomly generated arithmetic problems of various types.
>
> The target of the problems (my daughter) would prefer that the thousands
> be delimited. Is there a string function that does this?
You refer to something like putting a comma between groups of three
digits, as in 1,000? This is locale-specific, and there's a "locale"
module that should have what you need.
-Peter
More information about the Python-list
mailing list