Time of Update: 2016-12-05
標籤:div bsp 進位 nbsp 方法 hello 產生 檔案 import python程式的運行方式大致可以分為兩種,一種是直接通過python解譯器直接解釋型運行,另外一種是先把pyt
Time of Update: 2016-12-03
標籤:替換 -- 內容 字串串連 範圍 過濾 方法 printf 語言 Python總最常用的類型,使用單引號雙引號表示。三引號之間的字串可以跨多行並且可以是原樣輸出的。Python中不支援字元
Time of Update: 2016-12-03
標籤:value tty 複製 target http efault 沒有 sdi 字典 建立:dict = {‘Name‘: ‘Zara‘, ‘Age‘: 7, ‘Class‘:
Time of Update: 2016-12-04
標籤:style utf-8 from text import end class login blog 發送郵件函數功能 1 #!/usr/bin/env python 2 # -*-
Time of Update: 2016-12-04
標籤:log server 視窗 bsp http class local 模組 modules python搭建好python開發環境後,怎麼查看api文檔呢?
Time of Update: 2016-12-04
標籤:str 重要 需要 表示 print sim 封裝 地址 執行個體 物件導向最重要的概念就是類(Class)和執行個體(Instance),必須牢記類是抽象的模板,比如Student類,而
Time of Update: 2016-12-04
標籤:__new__ mat sleep amp art tle log rac tuple 英文文檔:vars([object])Return the __dict__ attribute
Time of Update: 2016-12-02
標籤:oba install 連接埠 local 組件 解決方案 publish mini 操作 需求產生情境:
Time of Update: 2016-12-03
標籤:查看 bin 判斷 error break .so min object ems 1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3
Time of Update: 2016-12-04
標籤:python linux 在LINUX Centos 7.1安裝Python 3.5.2操作步聚如下:1) 設定語言環境 export LANG=en_GB.utf82)安裝DEVTOOLSETyum groupinstall "Development tools" 3) 安裝依賴包yum install zlib-develyum install bzip2-develyum install
Time of Update: 2016-12-03
標籤:nbsp linu split pen error class rip close else 如下是作業,用python做一個ftp,主要利用socket。server端在linux下運行
Time of Update: 2016-12-03
標籤:local tin 介紹 異常 ota 抽象 decode code 附加 學習內容:Python模組介紹1、經典類 or
Time of Update: 2016-12-03
標籤:python zipzip函數接受任意多個(包括0個和1個)序列作為參數,返回一個tuple列表。具體意思不好用文字來表述,直接看樣本:1.樣本1:x = [1, 2, 3]y = [4, 5, 6]z = [7, 8, 9]xyz = zip(x, y, z)print xyz啟動並執行結果是:[(1, 4, 7), (
Time of Update: 2016-12-03
標籤:unittest user div 模組 免費 tar 介紹 utf-8 pac 前言問: Python
Time of Update: 2016-12-02
標籤:span bin color 排序 begin down end code nbsp 1 #!/usr/bin/env python 2 3 def heap_sort(elems):
Time of Update: 2016-12-03
利用datetime模組進行不同時間單位的換算from datetime import timedelta a = timedelta(days=2, hours=6) b = timedelta(hours=4.5) c = a + b print(c.days) print(c.seconds) print(c.seconds / 3600) 表示特定的日期和時間 from datetime import datetime a = datetime(2016, 8, 30)
Time of Update: 2016-12-03
主要應用情境為:有變動需求的一次性定時任務。 通過redis到期事件的監聽,執行相應命令。(注意:因為監聽只能得到key, 所以需要另外儲存具體執行內容體) 另外記得修改redis配置:notify-keyspace-events Ex import redis rdc = redis.StrictRedis() pubsub = rdc.pubsub() pubsub.psubscribe("__keyevent@0__:expired")
Time of Update: 2016-12-02
字串去除空白 ,strip() , 包括空格,tab鍵, 分行符號>>> name = " Frank ">>> name.strip()'Frank'字串的分割, split("分隔字元"),分組後成為一個列表>>> name = "Apple, banbana, orice">>> name.split(",")['
Time of Update: 2016-12-04
python requests 安裝,pythonrequests在 windows 系統下,只需要輸入命令 pip install requests ,即可安裝。在 linux 系統下,只需要輸入命令 sudo pip install requests ,即可安裝。或者=================Window1. 下載requests
Time of Update: 2016-12-02
Python 描述符(Descriptor)入門,pythondescriptor很久都沒寫 Flask 代碼相關了,想想也真是慚愧,然並卵,這次還是不寫 Flask 相關,不服你來打我啊(就這麼賤,有本事咬我啊這次我來寫一下 Python 一個很重要的東西,即 Descriptor (描述符)初識描述符老規矩, Talk is cheap,Show me the code. 我們先來看看一段代碼classPerson(object):""""""#-----------------------