need help with re module

2007-06-20 Thread linuxprog
hello

i have that string "helloworldok" and i want to 
extract all the text , without html tags , the result should be some 
thing like that : helloworldok

i have tried that :

from re import findall

chaine = """helloworldok"""

print findall('[a-zA-z][^(<.*>)].+?[a-zA-Z]',chaine)
  
   >>> ['html', 'hell', 'worl', 'anyt', 'ag>o']

the result is not correct ! what would be the correct regex to use ?



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


Re: strip() 2.4.4

2007-06-21 Thread linuxprog

Stephen R Laniel a écrit :

On Thu, Jun 21, 2007 at 06:23:01AM -0700, Nick wrote:
  

Why is there a apostrophe still at the end?



Is it possible that you actually have whitespace at the end
of the line? So then strip() is looking for an apostrophe at
the end of the line, not finding it, and therefore not
stripping it?

  

that should work for you ?

f1 = open('in.txt', 'r')

for line in f1:
  print line.rsplit(':')[4].rstrip().strip("'"),

maybe you got some \n \r at the end of each line
-- 
http://mail.python.org/mailman/listinfo/python-list

SOAP : ZSI error

2007-09-03 Thread linuxprog
hello i need some help with ZSI module
i want to use the web service located here 
www.ebob42.com/cgi-bin/NumberToWordsInDutch.exe/soap/IDutch
the wsdl file : 
http://www.ebob42.com/cgi-bin/NumberToWordsInDutch.exe/wsdl/IDutch
that web service is very simple , the function NumToStr converts numbers 
to dutch words (description 
http://www.xmethods.net/ve2/ViewListing.po?key=uuid:01EF9AE1-6DD3-7317-AFA5-05A8A52FCD56)

i have generated IDutchservice_services with wsdl2py
here is my code :

import IDutchservice_services
soap = 
IDutchservice_services.IDutchbindingSOAP("www.ebob42.com/cgi-bin/NumberToWordsInDutch.exe/soap/IDutch")
ok = IDutchservice_services.NumToStr0Request()
ok.Num=5
print soap.NumToStr(ok)

that prints an error RuntimeError: must specify transport or url 
startswith https/http

what's wrong in my script ? thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


SOAPpy Error

2007-09-24 Thread linuxprog
hi all

i'm building a webservice client with soappy

when i send some informations it's returns an error
here is the informations that generates the error
var = SOAPpy.structType()
var._addItem("code", u"XysZjd")
var._addItem("value", 1)
when i send the var variable SOAPpy prints this

  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 473, in 
__call__
return self.__r_call(*args, **kw)
  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 495, in 
__r_call
self.__hd, self.__ma)
  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 366, in __call
config = self.config)
  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 228, in call
data = r.getfile().read()
AttributeError: 'NoneType' object has no attribute 'read'

when i have activate debug , the debug mode shows :
code :  -1
msg : 
headers : None

it should prints some thing like this if all goes well :
code :  200
msg :  OK
headers : Date: Mon, 24 Sep 2007 09:08:45 GMT
Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7
X-Powered-By: PHP/5.2.0-8+etch7
Content-Length: 2116
Connection: close
Content-Type: text/xml; charset=utf-8

wha's wrong ?

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


Re: SOAPpy Error

2007-09-24 Thread linuxprog
linuxprog a écrit :
> hi all
>
> i'm building a webservice client with soappy
>
> when i send some informations it's returns an error
> here is the informations that generates the error
>var = SOAPpy.structType()
>var._addItem("code", u"XysZjd")
>var._addItem("value", 1)
> when i send the var variable SOAPpy prints this
>
>  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 473, in 
> __call__
>return self.__r_call(*args, **kw)
>  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 495, in 
> __r_call
>self.__hd, self.__ma)
>  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 366, in 
> __call
>config = self.config)
>  File "C:\Python23\lib\site-packages\SOAPpy\Client.py", line 228, in call
>data = r.getfile().read()
> AttributeError: 'NoneType' object has no attribute 'read'
>
> when i have activate debug , the debug mode shows :
> code :  -1
> msg : headers : None
>
> it should prints some thing like this if all goes well :
> code :  200
> msg :  OK
> headers : Date: Mon, 24 Sep 2007 09:08:45 GMT
> Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7
> X-Powered-By: PHP/5.2.0-8+etch7
> Content-Length: 2116
> Connection: close
> Content-Type: text/xml; charset=utf-8
>
> wha's wrong ?
>
> Thanks
>
still no answer !?
-- 
http://mail.python.org/mailman/listinfo/python-list