Python待完善

1. Python SimpleHTTPServer代碼解析


2. Python 清屏程序

def cls():
    import os
    os.system("cls")

3. Python 延時

print "Start"
time.sleep(10)
print "Fin"

4. Python 發送郵件

# -*- coding: utf-8 -*-
from email.mime.text import MIMEText
msg = MIMEText('hello, send by Python...', 'plain', 'utf-8')

# 輸入Email地址和口令:
from_addr = '[email protected]'
password = '*****'
# 輸入SMTP服務器地址:
smtp_server = 'smtp.126.com'
# 輸入收件人地址:
to_addr = '[email protected]'

print "OK"

import smtplib
server = smtplib.SMTP(smtp_server, 25) # SMTP協議默認端口是25
server.set_debuglevel(1)
server.login(from_addr, password)
server.sendmail(from_addr, [to_addr], msg.as_string())
server.quit()


5. Python優酷視頻下載

腳本下載地址:

           https://github.com/iambus/youku-lixian

腳本使用說明:

從優酷網站上下載flv或mp4格式的視頻文件(包括分段視頻的拼接)。友情支持bilibili,acfun,新浪,酷6,pptv,愛奇藝,土豆,搜狐,56,cntv,yinyuetai,鳳凰網。除Python標準庫外無第三方依賴。測試環境:Python 2.7。

python youku.py urls...
python youku.py --playlist url

發佈了34 篇原創文章 · 獲贊 14 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章