Re: strange behaviour of colon within string

2009-10-19 Thread khany
On 19 Oct, 14:44, StarWing  wrote:
> On Oct 19, 9:15 pm, khany  wrote:
>
>
>
>
>
> > On 19 Oct, 13:44, khany  wrote:
>
> > > hello all,
>
> > > i am relatively new to python and i am trying to convert a php app i
> > > have over to it using googleapps.
>
> > > anyway here is the problem. i poll ebay API which has in its XML " > > xml version="1.0" encoding="utf-8"?> > > xmlns="http://www.ebay.com/marketplace/search/v1/services";>   "
>
> > > however it fails to create the string UNLESS i remove the colon (:) in
> > > the http section. i tried to substitute it with chr(58) but it errors
> > > the same without showing why. does anyone know what i am doing wrong?
> > > is this peculiar to googleapps?
>
> > > thanks
>
> > OK
>
> > first thanks for replying so soon (most other groups out there take
> > days)
>
> > here is the code
>
> > 
> >   xml = ' \
> >     http://www.ebay.com/marketplace/
> > search/v1/services"> \
> >     %(category)i \
> >     %(searchtext)s \
> >      \
> >       %(page)i \
> >       10 \
> >      \
> >     ' % \
> >     {'category':9834, 'searchtext':"bmw", 'page':1}
> >   print xml
> > 
>
> > if i run this, the page is blank (even the source) with no errors or
> > anything. if i remove the colon from the string (after the http) it
> > prints the string on the browser fine.
>
> > HTH
>
> you can use a tri-quote string or make sure all lines end with \:
> xml1 = """
>     http://www.ebay.com/marketplace/\
> search/v1/services">
>     %(category)i
>     %(searchtext)s
>     
>       %(page)i
>       10
>     
>     """ % \
>     {'category':9834, 'searchtext':"bmw", 'page':1}
>
> xml2 = '\n\
>     http://www.ebay.com/marketplace/\
> search/v1/services">\n\
>     %(category)i\n\
>     %(searchtext)s\n\
>     \n\
>       %(page)i\n\
>       10\n\
>     \n\
>     ' % \
>     {'category':9834, 'searchtext':"bmw", 'page':1}
>
> print xml1
> print xml2

StarWing,

The triple String works a treat thanks. Not sure what the colon issue
was though. Now im getting Unsupported verb errors but thats an ebay
API issue i can work with.

Thanks to all for your help

khany
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: strange behaviour of colon within string

2009-10-19 Thread khany
On 19 Oct, 13:44, khany  wrote:
> hello all,
>
> i am relatively new to python and i am trying to convert a php app i
> have over to it using googleapps.
>
> anyway here is the problem. i poll ebay API which has in its XML " xml version="1.0" encoding="utf-8"?> xmlns="http://www.ebay.com/marketplace/search/v1/services";>   "
>
> however it fails to create the string UNLESS i remove the colon (:) in
> the http section. i tried to substitute it with chr(58) but it errors
> the same without showing why. does anyone know what i am doing wrong?
> is this peculiar to googleapps?
>
> thanks

OK

first thanks for replying so soon (most other groups out there take
days)

here is the code


  xml = ' \
http://www.ebay.com/marketplace/
search/v1/services"> \
%(category)i \
%(searchtext)s \
 \
  %(page)i \
  10 \
 \
' % \
{'category':9834, 'searchtext':"bmw", 'page':1}
  print xml


if i run this, the page is blank (even the source) with no errors or
anything. if i remove the colon from the string (after the http) it
prints the string on the browser fine.

HTH
-- 
http://mail.python.org/mailman/listinfo/python-list


strange behaviour of colon within string

2009-10-19 Thread khany
hello all,

i am relatively new to python and i am trying to convert a php app i
have over to it using googleapps.

anyway here is the problem. i poll ebay API which has in its XML "http://www.ebay.com/marketplace/search/v1/services";>   "

however it fails to create the string UNLESS i remove the colon (:) in
the http section. i tried to substitute it with chr(58) but it errors
the same without showing why. does anyone know what i am doing wrong?
is this peculiar to googleapps?

thanks
-- 
http://mail.python.org/mailman/listinfo/python-list