網頁

顯示具有 Python 標籤的文章。 顯示所有文章
顯示具有 Python 標籤的文章。 顯示所有文章

2016年2月9日 星期二

Python - List

Last Update: 2016/02/09 21:28+08



Intro


List 宣告方法
my_list = [0,1,2,3,4,5,6,7,8,9]

P.S. 陣列物件: numpy.array



Python - Dictionary

Last Update: 2016/02/09 20:44+08



Intro


Dictionary (字典) 宣告 axis=x, 為第 x 維度合併
dict = {"a": 1, "b": 2, "c":3}
dict = {} #可宣告空 Dictionary 



Python - Array

Last Update: 2016/02/09 17:59+08



Intro


Python 陣列的相關用法(廢話XD
a = numpy.array([0,1,2,3,4,5,6,7,8,9])

P.S. list() 物件



2016年2月8日 星期一

Python - Package, Module & Class

Last Update: 2016/02/08 21:22+08



Package, Module & Class
Python是以資料夾結構來定義程式結構
資料夾=Package (or namespace)
檔案.py=Module
在檔案裡宣告Class
from package01.package02.module01 import class01

Package(資料夾) 底下通常會有個 __init__.py 檔案
是載入Package時會執行的敍述, 一般令其為空的就可以了
Class 宣告
Class 的建構子為 __init__
必帶 self 同等 this
欄位宣告如下
class DataSet:
    def __init__(self):
        self.train = numpy.array([[]])
        self.train_taget = numpy.array([[]])
        self.test = numpy.array([])
        self.test_target = numpy.array([])



2016年1月31日 星期日

Python - PIP

Last Update: 2016/1/31 20:51+08



Intro

PIP 使用記事


2016年1月27日 星期三

IPython

Last Update: 2016/1/27 09:46+08



Intro


安裝
#Python
python-dev
#Python3 - pip3
sudo apt-get install -y python3-pip
sudo pip3 install jupyter
#Python2 - pip
sudo apt-get install python-pip
sudo pip install jupyter 

#執行
jupyter notebook --no-browser --ip=0.0.0.0 --port=8888



2016年1月26日 星期二

Python - 零碎記事

Last Update: 2016/1/27 01:37+08



Intro

零碎的Python記事



2011年7月1日 星期五

Python Config Yaml File

Last Update: 2011/07/01 17:32+08
Type: Note


• Static Page/File and so on:

- url: /common/menu.html
static_files: common/menu.html
upload: common/menu.html



• Static Directory

- url: /css
static_dir: css



• Script

- url: /product
script: script/product.py



• Extension/Regular on one directory
\1 : url 的 regular

- url: /(common/.*\.(html|png))
static_files: \1
upload: (common/.*\.(html|png))

#Rewrite Path
- url: /(.*\.(html|png))
static_files: common/\1
upload: common/(.*\.(html|png))