From: D-Man <ds...@ri...> - 2001-07-20 18:42:20
|
On Fri, Jul 20, 2001 at 06:31:37PM +0200, Joern Eckhoff wrote: | > Joern Eckhoff wrote: | > > | > > ... | > > Or any hint how to convert an INT to a | > > STRING without using this intricately solution? | > | > Why can't you just use the back-quotes?: | > | > >>> a=123 | > >>> print 'test' + `a` | > test123 | > >>> | > | > (the BACK-Quotes are below the tilde '~' on my keyboard). | | MY computer says: | | >>> a=123 | >>> print 'test'+'a' | testa | >>> _ | | :-( Yeah, with single quotes not backquotes :-). | ... *truncate* ... eeerm, one moment, please ... | | >>> a=123 | >>> print 'test'+`a` | test123 | >>> _ FYI, the backquotes call str() (or is it repr()? They are very similar anyways). So the following is identical, but slightly more verbose : >>> a=123 >>> print 'test' + str( a ) test123 >>> -D |