Time of Update: 2016-11-04
標籤:無法 integer ring classes 模組 sql val log rom type 其實就是元類,type 是python 背後建立所有對象的元類 python
Time of Update: 2016-11-05
標籤:預設 basic 參數 是你 one 可讀性 問題: 支援 任務 函數 一、函
Time of Update: 2016-11-04
標籤:centos blog 路徑 軟連結 log 檔案 系統 工作 yum 查看當前的Python版本:#python -VPython
Time of Update: 2016-11-01
標籤:python一、對象值的比較1、比較的操作是針對對象的值進行比較的2、也就是說比較的是對象的值,而不是對象本身等價於值和值的直接比較:>>> >>> 2 == 2True>>> 2.46 <= 8.33True對象值的比較>>> a = 88>>> b = 98>>> >>> a == bFalse>>> a >= bFalse>
Time of Update: 2016-10-31
標籤:blog 輸入 return 目標 win32 gui 標題 自己 ttext 苦逼的在sf上等了一天(問題連結),都沒人來解答,只好自己想辦法,東平西湊還是勉強實現了,記錄一下:安裝完p
Time of Update: 2016-10-28
標籤:簡單 lis origin 異常 ipython frame developer list 快速鍵 Rui L連結:https://www.zhihu.com/question/21572
Time of Update: 2016-10-28
標籤:lambda 快速 多個 string nbsp pytho 定義 add 支援 Python內建了一些特殊函數,這些函數很具python特性。可以讓代碼更加簡潔。可以看例子:1 
Time of Update: 2016-10-28
標籤:運行 建立 儲存 linu 為什麼 輸入 如何學習 技能 輸出 編程零基礎如何學習Python
Time of Update: 2016-10-28
標籤:函數嵌套 for 傳遞 函數 erro bsp max log 調用 [Package] keywords所有關鍵字封裝[Class] _waiting.py等待函數的條件判斷,
Time of Update: 2016-10-28
標籤:highlight tar range [] 小遊戲 iss start and point #小遊戲,搖篩子押大小的小遊戲import random#定義搖篩子的函數:def roll_
Time of Update: 2016-11-07
最近對Python 的對象引用機制稍微研究了一下,留下筆記,以供查閱。首先有一點是明確的:「Python 中一切皆對象」。那麼,這到底意味著什麼呢?如下代碼:#!/usr/bin/env pythona = [0, 1, 2] # 來個簡單的list# 最初,list 和其中各個元素的id 是這樣的。print 'origin'print id(a),afor x in a: print id(x), xprint '----------------------
Time of Update: 2016-11-07
在liunx系統中要想每隔一分鐘執行一個命令,最普遍的方法就是crontab了,如果不想使用crontab,經同事指點在程式中可以用定時器實現這種功能,於是就開始摸索了,發現需要一些訊號的知識...查看你的linux支援哪些訊號:kill -l 即可root@server:~# kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS
Time of Update: 2016-11-07
代理類型(proxy):透明代理 匿名代理 混淆代理和高匿代理. 這裡寫一些python爬蟲使用代理的知識, 還有一個代理池的類. 方便大家應對工作中各種複雜的抓取問題。urllib 模組使用代理urllib/urllib2使用代理比較麻煩, 需要先構建一個ProxyHandler的類, 隨後將該類用於構建網頁開啟的opener的類,再在request中安裝該opener.代理格式是"http://127.0.0.1:80",如果要帳號密碼是"http://user:password@127.0
Time of Update: 2016-11-07
cookielib是一個自動處理cookies的模組,如果我們在使用爬蟲等技術的時候需要儲存cookie,那麼cookielib會讓你事半功倍!他最常見的搭檔模組就是python下的urllib和request。核心類1.Cookie該類實現了Netscape and RFC 2965 cookies定義的cookie標準,基本可以理解為某一條cookie資料。部分代碼如下,很多屬性是不是很眼熟? self.domain_initial_dot = domain_initial_dot
Time of Update: 2016-11-07
在Python2和Python3中都提供print()方法來列印資訊,但兩個版本間的print稍微有差異主要體現在以下幾個方面:1.python3中print是一個內建函數,有多個參數,而python2中print是一個文法結構;2.Python2列印時可以不加括弧:print 'hello world', Python3則需要加括弧 print("hello
Time of Update: 2016-10-31
1、Python版本 Python 2.x的版本的,被稱為Python2:是目前用的最廣泛的,比如Python 2.7.12。 Python 3.x的版本的,被稱為Python3:是最新的版本的,比如Python 3.5.2。長遠來看,也算是以後的趨勢。 針對初學者:建議用Python2,因為目前太多的Python程式,範例程式碼,第三方庫,都還是針對Python 2.x的較多,比較好,比較穩定。 2、下載Python Python的官網是:http://www.python.org/
Time of Update: 2016-10-29
JSON模組JSON(JavaScript Object Notation) 是一種輕量級的資料交換格式。它基於ECMAScript的一個子集。
Time of Update: 2016-11-05
Python內建函數(38)——list,python內建38list英文文檔:class list([iterable]) Rather than being a function, list is actually a mutable sequence type, as documented in Lists and Sequence Types — list, tuple, range 說明: 1. list函數,實際是上清單類型的建構函式。 2.
Time of Update: 2016-11-02
Python內建函數(31)——id,python內建函數31英文文檔:id(object)Return the “identity” of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id()
Time of Update: 2016-10-31
Python內建函數(29)——help,python內建29help英文文檔:help([object]) Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a