Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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__
  


Ïà¹ØÎĵµ£º

Python ÓÐÈ¨ÖØµÄËæ»úÑ¡Ôñ£¬ Weighted Random Choice

import random def windex(lst):
    '''an attempt to make a random.choose() function that makes weighted choices
    accepts a list of tuples with the item and probability as a pair'''
    wtotal = sum([x[1] for x in lst])
   ......

Python·¢ËÍÌìÆøÔ¤±¨ÐÅÏ¢µ½ÊÖ»ú

writeblog.csdn.net writeblog.csdn.net/PostEdit.aspx
Õâ¸ö³ÌÐòºÜÔçÒÔǰ¾Íд¹ýÁË£¬¶øÇÒÊDzο¼µÄ±ðÈ˵Äд£¬¾ßÌåË­µÄ·¢ÔÚÄÄÀïÎÒ¶¼Íü¼ÇÁË¡£ÕâÀï¾ÍËãÊǰëÔ­´´ÁË£¬ÈçÓÐÇÖȨÇ뼰ʱ֪ͨ¸ÄÕý¡£
ÒòΪ´Ó½ñÌì1ÔÂ1ºÅ¿ªÊ¼£¬GoogleÉ϶©ÔĵÄÌìÆøÔ¤±¨·þÎñÒѾ­È¡ÏûÁË£¬¹À¼ÆÊÇGoogle±»Ê©¼ÓѹÁ¦ÁË¡£·´ÕýÊÇÊÕ²»µ½ÌìÆøÔ¤±¨ÁË¡£ÕýºÃÖØÊ°ÒÔǰ ......

cÅÌÕûÀí Python½Å±¾

ÄÜÕûÀí´ó²¿·ÖÎÞÓÃÎļþ
#!/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)
......

×Ô¶¯½âѹ´óÁ¿Ñ¹ËõÎļþ Python ½Å±¾

֮ǰдÁËÒ»¸ö×Ô¶¯½âѹѹËõÎļþµ½Ñ¹ËõÎļþËùÔÚÎļþ¼ÐµÄ½Å±¾
ºó¸ù¾Ý×Ô¼ºÐèÒª£¬Ð´ÁËÁíÍâÁ½¸ö¡£Ô­ÀíÒ»Ñù
¶¼ÊÇʹÓÃwinrarµÄÃüÁî
µÚÒ»¸ö½Å±¾Ã»¿¼ÂÇÖܵ½£¬Ö»ÄܽâѹrarÎļþ
¸Ä½øºó¿ÉÒÔÖ§³ÖwinrarÖ§³ÖµÄ¸÷ÖÖÎļþ
°ÑÖ¸¶¨Îļþ¼ÐϵÄÎļþ±£´æµ½Ö¸¶¨Îļþ¼Ð
#rardir.py
import os
import sys
src=sys.argv[1]
dst=sys.argv[2]
......

python±àÂëÎÊÌâºÍi18n

ת×Ô http://www.javaeye.com/topic/66558
³õѧPython,Óöµ½ºÜ¶à±àÂëÎÊÌ⣬¼ÇÏÂÀ´ÒÔÃ⽫À´ÓÖÍüÁË£¬ºÜ¶à¶«Î÷²»¶®£¬¶¼ÊÇÊôÓÚ²»ÇóÉõ½â£¬ÂÒϽáÂÛ£¬µ«Ïëµ½ÄóöÀ´¿ÉÒÔÓÐÈÈÐÄͬѧָ³ö´íÎóËùÔÚ£¬±ãºñÆðÁ³Æ¤ÁË……
Ê×ÏÈÐèÒªÁ˽âPythonÖÐÓÐÁ½ÖÖ×Ö·û´®(ÑϸñµØËµ,ËÆºõ²»ÄÜÕâô½Ð)¡£Ò»ÖÖÊÇÆÕͨµÄstr¶ÔÏó£¨Ã¿¸ö×Ö·ûÓÃ8bits± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ