converting to string

Josef Dalcolmo dalcolmo at vh-s.de
Wed Aug 4 09:35:08 CEST 2004


on Wed, 04 Aug 2004 17:03:10 +1000
Ajay Brar <abra9823 at mail.usyd.edu.au> wrote:

> how do i go about converting a Python object or tuple to a string.

I guess the simplest is to use the built-in functions: str or repr

str(object) if you just need a printable string
repr(object) if you need to reconstruct later the original object from the string

- Josef



More information about the Python-list mailing list