- 更新一個已知名稱的 Python package,如 numpy package
pip install -U numpy或是
pip install --upgrade numpy
pip list |awk '{print $1}' |xargs -n 1 pip install --upgrade
或是
for i in `pip list |awk '{print $1}'`; do echo $i; pip install --upgrade $i; done
#
pip install -U numpy或是
pip install --upgrade numpy
pip list |awk '{print $1}' |xargs -n 1 pip install --upgrade
或是
for i in `pip list |awk '{print $1}'`; do echo $i; pip install --upgrade $i; done
C:\Windows\system32>robocopy
---------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
---------------------------------------------------------------------
已啟動 : Mon Jan 04 11:19:12 2016
簡單使用方式 :: ROBOCOPY source destination /MIR
source :: 來源目錄 (drive:\path 或 \\server\share\path)。
destination :: 目的地目錄 (drive:\path 或 \\server\share\path)。
/MIR :: 鏡像完整的樹狀目錄。
如需有關使用方式的詳細資訊,請執行 ROBOCOPY /?
**** /MIR 可以刪除檔案以及複製檔案!
robocopy C:\來源資料夾1\ D:\目標資料夾1\ /MIR /XO /E /R:2 robocopy C:\我的資料夾\ D:\備份資料夾\ /MIR /XO /E /R:2編輯完成後,記得存檔喔~
![]() |
| Windows 按鈕 > 執行(R) |
| 開啟(O) : %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup |
![]() |
| 新增批次檔的捷徑或將批次檔儲存於啟動資料夾中 |
| 接受軟體授權協議 |
![]() |
| 如果不需要先取消每周自動更新檢查 |
![]() |
| 設定切換語言 > 正體中文 |
![]() |
| 選擇另存為批次處理作業 |
| 這裡我們選擇忽略錯誤處理、同步完成後關閉進度對話盒 |
![]() |
| Windows 按鈕 > 執行(R) |
| 開啟(O) : %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup |
![]() |
| 新增設定檔的捷徑 |
export http_proxy=http://proxy.hinet.net:80 export https_proxy=http://proxy.hinet.net:80 pip install jieba
# coding=utf-8
# encoding=utf-8
import requests
from bs4 import BeautifulSoup
import jieba
res = requests.get("https://news.google.com")
soup = BeautifulSoup(res.text)
count = 1
for item in soup.select(".esc-body"):
print '======[',count,']========='
news_title = item.select(".esc-lead-article-title")[0].text
news_url = item.select(".esc-lead-article-title")[0].find('a')['href']
print("News Title: "+news_title)
print("News Url: "+news_url)
# 載入使用者自建詞庫
jieba.load_userdict("userdict.txt")
# 對 news_title 進行中文分詞
print ''
print ' -------進行中文分詞-------'
words = jieba.cut(news_title, cut_all=True)
print(" Full Mode: " + "/ ".join(words))
words = jieba.cut(news_title, cut_all=False)
print(" Default Mode: " + "/ ".join(words))
words = jieba.cut_for_search(news_title)
print(" Search Engine Mode: " + ", ".join(words))
print ''
count += 1
======[ 41 ]========= ... News Title: 包塑膠袋泡冰水男順利接回斷指 News Url: http://udn.com/news/story/7266/1406918-%E5%8C%85%E5%A1%91%E8%86%A0%E8%A2%8B%E6%B3%A1%E5%86%B0%E6%B0%B4-%E7%94%B7%E9%A0%86%E5%88%A9%E6%8E%A5%E5%9B%9E%E6%96%B7%E6%8C%87 -------進行中文分詞------- Full Mode: 包/ 塑/ 膠/ 袋/ 泡/ 冰水/ 男/ 順/ 利/ 接回/ 斷/ 指 Default Mode: 包塑/ 膠袋/ 泡/ 冰水/ 男順利接/ 回斷/ 指 Search Engine Mode: 包塑, 膠袋, 泡, 冰水, 男順利接, 回斷, 指 ======[ 42 ]========= News Title: 與林口長庚同等級土城醫院開工 News Url: http://www.chinatimes.com/newspapers/20151229000446-260106 -------進行中文分詞------- Full Mode: 與/ 林口/ 長/ 庚/ 同等/ 級/ 土城/ 醫/ 院/ 開/ 工 Default Mode: 與/ 林口/ 長/ 庚/ 同等/ 級/ 土城/ 醫院/ 開工 Search Engine Mode: 與, 林口, 長, 庚, 同等, 級, 土城, 醫院, 開工
| Google 新聞-焦點新聞 範例 |
export http_proxy=http://proxy.hinet.net:80 export https_proxy=http://proxy.hinet.net:80 pip install requests pip install BeautifulSoup4
# coding=utf-8
import requests
from bs4 import BeautifulSoup
res = requests.get("https://news.google.com")
soup = BeautifulSoup(res.text)
print soup.select(".esc-body")
count = 1
for item in soup.select(".esc-body"):
print '======[',count,']========='
news_title = item.select(".esc-lead-article-title")[0].text
news_url = item.select(".esc-lead-article-title")[0].find('a')['href']
print news_title
print news_url
count += 1
#!/usr/bin/env python3
# coding=utf-8
# -*- coding: utf8 -*-
from urllib.request import urlopen
from bs4 import BeautifulSoup
res = urlopen("https://news.google.com")
soup = BeautifulSoup(res, "html.parser")
#print soup.select(".esc-body")
count = 1
for item in soup.select(".esc-body"):
print('======[',count,']=========')
news_title = item.select(".esc-lead-article-title")[0].text
news_url = item.select(".esc-lead-article-title")[0].find('a')['href']
print(news_title)
print(news_url)
count += 1
======[ 1 ]========= 美河市案宣判柯P解讀:2個小官非常賤 http://www.chinatimes.com/realtimenews/20151228002594-260401 ======[ 2 ]========= 北海道巴士對撞11台灣客受傷【更新】 http://www.cna.com.tw/news/firstnews/201512285015-1.aspx ======[ 3 ]========= 邱毅再爆816專案小英研究兩國論索262萬 http://www.chinatimes.com/realtimenews/20151228002822-260401 ======[ 4 ]========= 芝加哥警射殺2非裔家屬淚訴停止暴力 http://www.cna.com.tw/news/firstnews/201512285013-1.aspx ... ======[ 40 ]========= 食安再爆!素食也不安全蒟蒻竟摻工業用碱粉 http://www.uho.com.tw/hotnews.asp?aid=39330 ======[ 41 ]========= (用錯染髮劑增膀胱癌風險,3大守則安心變色/圖片取自優活健康網) http://www.uho.com.tw/hotnews.asp?aid=39317 ======[ 42 ]========= 當市長完成創傷急救體系柯P感概想到朱立倫 http://news.ltn.com.tw/news/politics/breakingnews/1553878