use re module instead:
import re
s = "helo world niceday"
res = re.split("\s+",s)
print res
result:
['helo', 'world', 'nice', 'day']
Sincerely Yours,
Pujo
--
http://mail.python.org/mailman/listinfo/python-list
> As Sidharth Kuruvila pointed out, time.strftime() is probably
> the best choice for your situation. For the general case of
> removing whitespace from a sting, one method is:
>
> ''.join(mystring.split())
Alternatively, you could do something like:
import string
for c in string.whitespace:
Dylan Wilson wrote:
> Now i need to compond that string remove the whitespace if you will.Well
> i read up on strip(), lstrip() and rstrip() and all i could deduce was
> that they striped the whitespace from the start and/or end of the
> string.But I tried that anyway and failed.Is there an easier
The time module has a function called 'strftime' which can retyrn the
time in the the format you want to. So you really don't need to parse
the string returned by asctime the way you are doing.
On Apr 8, 2005 6:01 PM, Dylan Wilson <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm new to python and i have a