pythonºÍdotnetµÄwebservice»¥·Ã
2007-08-22 22:46
Ò»¡¢ÓÃSOAPpy·ÃÎÊdotnet webservice
dotnetµÄwebservice
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
<WebMethod()> _
Public Function HelloWorld2(ByVal s As String) As String
Return "Hello World2" + s
End Function
<WebMethod()> _
Public Function HelloWorld3(ByVal i As Int16, ByVal j As Int16) As String
Return "Hello World3" + (i + j).ToString()
End Function
ÃüÃû¿ÕÒôºó¼ÓÒ»¾ä SoapDocumentService(Use:=SoapBindingUse.Encoded)
·ÃÎÊ
>>>from SOAPpy import WSDL
>>> server= WSDL.Proxy("http://192.168.1.3/mywebservice/Service1.asmx?WSDL
")
>>> server.HelloWorld()
'Hello World'
>>> server.HelloWorld('abcdefg')
'Hello World'
>>> server.HelloWorld2('abcdefg')
'Hello World2'
>>> server.HelloWorld2(s = 'abcdefg') #ÓвÎÊýʱ£¬Ðè´øÉϲÎÊýÃû
'Hello World2abcdefg'
>>> server.HelloWorld3(i=1,j=2) #ÔÝδ½â¾ö
Traceback (most recent call last):
File "<pyshell#43>", line 1, in -toplevel-
server.HelloWorld3(i=1,j=2)
File "c:\python24\Lib\site-packages\SOAPpy\Client.py", line 453, in __call__
Ïà¹ØÎĵµ£º
תÔØ×Ô£ºhttp://purpen.javaeye.com/blog/98095
python Ö´ÐÐϵͳÃüÁî±È½Ï
¹Ø¼ü×Ö: python os system ϵͳÃüÁî
Ôڴ˱ȽÏÒ»ÏÂÁ½ÖÖ·½·¨Ö´ÐÐϵͳÃüÁîµÄ·½·¨,ÒÔ·½±ãÓÚÈÕºóÔËÓÃ:(
1. os.system()
system(command) -> exit_status
Execute the  ......
ÄÜÕûÀí´ó²¿·ÖÎÞÓÃÎļþ
#!/usr/bin/python
#syscleaner.py
import os
import os.path
#delete files and directory recursively
def itedel(dir):
print('in dir :'+dir)
for doc in os.listdir(dir):
try:
if(os.path.isdir(doc)):
itedel(dir+'\\'+doc)
......
֮ǰдÁËÒ»¸ö×Ô¶¯½âѹѹËõÎļþµ½Ñ¹ËõÎļþËùÔÚÎļþ¼ÐµÄ½Å±¾
ºó¸ù¾Ý×Ô¼ºÐèÒª£¬Ð´ÁËÁíÍâÁ½¸ö¡£ÔÀíÒ»Ñù
¶¼ÊÇʹÓÃwinrarµÄÃüÁî
µÚÒ»¸ö½Å±¾Ã»¿¼ÂÇÖܵ½£¬Ö»ÄܽâѹrarÎļþ
¸Ä½øºó¿ÉÒÔÖ§³ÖwinrarÖ§³ÖµÄ¸÷ÖÖÎļþ
°ÑÖ¸¶¨Îļþ¼ÐϵÄÎļþ±£´æµ½Ö¸¶¨Îļþ¼Ð
#rardir.py
import os
import sys
src=sys.argv[1]
dst=sys.argv[2]
......
http://blog.csdn.net/myan/archive/2008/01/07/2028545.aspx
http://blog.csdn.net/gashero/archive/2007/06/03/1636030.aspx
ÎҸоõ»¹ÊÇpythonÓ¦Óøü¹ãһЩ£¬RubyµÄRoR×öWeb¿ò¼ÜºÃһЩ°É£¬ÖÁÓÚperl£¬ÏÖÔڸоõʵÔÚÓм¸·Ö¿àɬ…… ......
ת×Ô http://www.javaeye.com/topic/561786
ÔÌû£ºhttp://www.cnblogs.com/jingleguo/archive/2008/06/02/1211820.html
µ±pythonÖм䴦Àí·ÇASCII±àÂëʱ£¬¾³£»á³öÏÖÈçÏ´íÎó£º
UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position 1: ordinal not in range(128)
0x??Êdz¬³ö128µÄÊý×Ö£¬pythonÔÚĬÈϵ ......