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

python pop3 ÊÕÓʼþ

def retrive_emails(pop3_server, user_name, passwd, server_port):
    #POP3
    pop_client = poplib.POP3(pop3_server, port=server_port)
    pop_client.user(user_name)
    pop_client.pass_(passwd)
   
    #print messages num
    num_messages, mbox_size = pop_client.stat()
    print 'there are %s new emails\n' % num_messages
    if num_messages == 0:
        pop_client.quit()
        return
    print('num of messages %s' %str(num_messages))
   
    #mk folder
    folder_name = '%s-%s' %(user_name, pop3_server)
    if not os.path.exists(folder_name):
        os.mkdir(folder_name)
       
    for idx in range(num_messages):         
        one_mail = pop_client.retr(idx+1)
        buf = cStringIO.StringIO()
        for j in one_mail[1]:           
            print >>buf,j 
        buf.seek(0)
       
        #parse mail content
        msg = email.message_from_file(buf)
        for part in msg.walk():
            contenttype = part.get_content_type()
            print('\npart:\n%s\n' % part)
      &


Ïà¹ØÎĵµ£º

PythonÖеÄһЩÒì³£

ÆäʵÒì³£¾ÍÊDz»Õý³££¬¾ÍÊDz»ºÍÎÒÃÇÏëÏóÒ»ÑùÈ¥Ö´ÐС£ËüÊÇÒòΪ³ÌÐò³öÏÖÁË´íÎó¶øÔÚÕý³£¿ØÖÆÁ÷ÒÔÍâ²ÉÈ¡µÄÐÐΪ¡£Python³öÏÖÒì³££¬¾ÍÊÇÒòΪ¼ì²éÁËÒ»¸ö´íÎóʱ£¬Python½âÊÍÆ÷ÎÞ·¨¼ÌÐø¼ÌÐøÖ´ÐÐÏÂÈ¥£¬ÕâʱºòÅ׳öÁËÒì³£¡£ÍùÍùÕâ¸ö´íÎó·ÖΪÓï·¨ÉϺÍÂß¼­ÉÏ(²»Éó¤Ëµ¸ÅÄ-_-! )£¬¿´¿´¼¸¸öÀý×Ó£¬×ܽáһϣº
1¡¢NameError£º³¢ÊÔ·ÃÎÊÒ»¸öÎ ......

Python ¿ªÆª

ÓÉÓÚ¹¤×÷ÐèÒª£¬ÓÖҪѧϰеĿª·¢ÓïÑÔ-Python£¬ ÓïÑÔѧ¹ý¼¸ÖÖÁË£¬ ¸Ð¾õ»¹ÊÇÓкöàÏàËƵĵط½£¬ Õâ¸öPython¸Ð¾õ¾Í¸úJavaÓкöàÏàͨµÄµØ·½£¬ Ê×ÏÈÄã¿ÉÒÔÔÚEclipseÉÏͨ¹ýÅäÖúóÀ´¿ª·¢Python¡£ÕâÀïÎÒÌý´ÓÁËÀÏ´óµÄ½¨Ò飬ÅäÖÃÁËÒ»¸öFlexBuilder ×÷ΪPythonµÄIDE½øÐпª·¢¡£
Ä¿Ç°¸Õ¿ªÊ¼Ñ§Ï°PythonµÄ»ù±¾Óï·¨£¬ ½ñÌìÖ÷Òª¿´ÁËÒ»ÏÂPyth ......

»°ËµPython£¨Ò»£©

С°×ºÍС²ËÊÇ´óѧͬѧ£¬Õâ²»¿ìÒª±ÏÒµÁË£¬Á©ÈËÒ»ºÏ¼Æ£¬ÕÒ¸öÅàѵ°àѧµã¶«Î÷£¬Îä×°Ò»ÏÂÍ·ÄÔ£¬Ë³±ã½â¾ö¾ÍÒµÎÊÌâ¡£
“ÄãÃÇÒª±¨Äĸö°à°¡£¿”½Ó´ýËûÃǵÄÄêÇáС½ãÈÈÐĵØÎʵÀ¡£
“ÄãÃÇÕâÀïÄĸö°à×îºÃ£¿”С°×²»¼Ù˼Ë÷µØ˵£¬“µ±È»ÊDZ¨×îºÃµÄ°àÀ²¡£”
“ÎÒÃǹ«Ë¾µÄÅàѵÏîÄ¿¶¼ºÜºÃ”С½ãЦ ......

Python µ÷ÓÃCAPICOM ¶ÁÈ¡ USB KEYÊý×ÖÖ¤Êé

import win32com.client
store = win32com.client.Dispatch('CAPICOM.Store')
# ´ò¿ªÖ¤Êé´æ´¢Çø
# 2 -> CAPICOM_CURRENT_USER_STORE
# 0 -> CAPICOM_STORE_OPEN_READ_ONLY
store.Open(2, "My", 0)
# ²éÕÒÓÐЧ֤Êé
# 12 -> CAPICOM_CERTIFICATE_FIND_KEY_USAGE
# 0x00000080 -> CAPICOM_DIGITAL_SIGNATU ......

python»æÖÆÂÝÐýÏß

#coding=utf-8
from math import sqrt,cos,sin
import Image, ImageDraw
class SpireShape(object):
    def __init__(self, draw):
        self.draw = draw
        self.line_width = 1
     & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ