Converting Integer to String

Jose Carlos Balderas Alberico josecarlos.balderas at gmail.com
Thu Apr 6 05:45:06 EDT 2006


That works just fine.Problem solved :)

Thank you so much for your help Wesley

Jose Carlos.


2006/4/6, Wesley Brooks <wesbrooks at gmail.com>:
>
> ...or
>
> '%i' %546
>
> gives:
>
> '546'
>
>
> Wesley Brooks.
>
>
> On 06/04/06, Wesley Brooks <wesbrooks at gmail.com > wrote:
> >
> > Jose Carlos,
> >
> > str(234) gives '234'
> >
> > Is that what your after?
> >
> > Wesley.
> >
> >  On 06/04/06, Jose Carlos Balderas Alberico <josecarlos.balderas at gmail.com>
> > wrote:
> >
> > >  Hello. I'm trying to turn an integer into a string, and the "repr"
> > function doesn't work the way I want.
> >
> > The repr function inserts a '\n' at the end of the string, and I need to
> > get the string representation without the '\n', since I need to insert the
> > stringed data into a sql query.
> >
> > I get "SELECT * FROM blah WHERE(code = 23\n)"
> >
> > I need to get rid of that "\n". Is there any other function I can use to
> > turn an integer into a string without the \n at the end?
> >
> > Thanks for your attention.
> >
> > Jose Carlos.
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
> >
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060406/672ee8e2/attachment.html>


More information about the Python-list mailing list