• Python 備忘錄
  • 簡介
  • Python 2.7.11
    • 從內建的 2.7.10 升級到 2.7.11
    • 建立虛擬環境
    • 為內建的 Vim 編輯器安裝 python-mode 外掛
    • 使用內建的 IDLE 整合開發環境
    • distutils, setuptools, pip, wheel
    • sys.argv, getopt, argparse
    • sys, os, re, subprocess
    • threading
    • json, PyYAML, csv, xml.etree.ElementTree, HTMLParser
    • pickle, shelve, dbm, sqlite3, Psycopg2, MySQL-python, PyMongo, redis
    • SQLAlchemy, SQLObject
    • urllib, urllib2, urllib3, httplib, httplib2, pycurl, pyquery, requests, httpie
    • boto3, google-api-python-client, azure
    • Tkinter, PyQt, PyGTK, wxPython
    • django, flask
    • doctest, unittest, nose, pytest, tox
    • pep8, flake8
    • CPython, PYPY, Cython, Jython, RPython, IronPython
    • IDLE, Vim, PyDev, Visual Studio Code, PyCharm, Pyzo, Kite
    • logging
  • Python 3.5.1
    • 安裝 3.5.1
    • 建立虛擬環境
    • 關鍵字與語法 :: import 陳述句
    • 關鍵字與語法 :: if 陳述句
    • 關鍵字與語法 :: while 陳述句
    • 關鍵字與語法 :: for 陳述句
    • 關鍵字與語法 :: try 陳述句
    • 關鍵字與語法 :: raise 陳述句
    • 關鍵字與語法 :: pass 陳述句
    • 關鍵字與語法 :: assert 陳述句
    • 關鍵字與語法 :: yield 陳述句
    • 關鍵字與語法 :: nonlocal 陳述句
    • 關鍵字與語法 :: global 陳述句
    • 關鍵字與語法 :: with 陳述句
    • 運算符與語法 :: @ 修飾符
    • 自定套件
    • 自定模組
    • 自定函式
    • 自定類別
    • 自定例外類別
    • 自定群集類別
    • 探討 :: 命名空間與可視範圍
    • 探討 :: 命名規則與命名風格
    • 探討 :: 物件參照與資料項目
    • 探討 :: 單星符號和雙星符號
    • 探討 :: 內建與標準型別分類
    • 探討 :: 群集型別迭代與複製
    • 探討 :: 抽象基礎類別
    • 探討 :: 元類別
    • 探討 :: 可變與不可變資料型態和傳值與傳址
    • 探討 :: Python Shell 與 Editor
    • 不再支援 :: print 陳述式
    • 不再支援 :: xrange 函式
    • 不再支援 :: basestring 型別
    • 不再支援 :: unicode 型別
    • 不再支援 :: file 型別
    • 內建函式 :: print
    • 內建函式 :: dir
    • 內建函式 :: isinstance
    • 內建函式 :: issubclass
    • 內建函式 :: id
    • 內建函式 :: repr
    • 標準類別 :: re
    • 標準類別 :: sys
    • 標準類別 :: keyword
    • 標準類別 :: os
    • 標準類別 :: disutils
    • 內建類別 :: str
    • 內建可呼叫的類別 :: type
    • 內建容器類別 :: list
    • 內建例外類別 :: Exception
    • 中英詞彙對照
    • 測驗
    • 其它
    • 附錄 :: 安裝支援 Python3 的 Vim 編輯器
  • Google API 1.5.0
    • API Client Library for Python
    • 探討 :: Google API 認證與授權
    • 範例 :: Google Calendar API
  • Apache Libcloud Library 0.20.1
    • 安裝
    • 範例 :: TryStack
  • Django 1.9.5
    • 安裝
    • 範例 :: Playground
    • 範例 :: Local
    • 範例 :: Heroku
    • 範例 :: Docker
    • 範例 :: Python Debugger
  • Python 2/3 Compatibility
  • PyCharm
    • Remote Debugging
  • 他人筆記
    • seanlin
Powered by GitBook

sys.argv, getopt, argparse

sys.argv, getopt, argparse

參考資料

  • http://www.cyberciti.biz/faq/python-command-line-arguments-argv-example/
  • https://docs.python.org/2/howto/argparse.html
  • https://docs.python.org/2.7/library/argparse.html
  • http://stackoverflow.com/questions/6365601/default-sub-command-or-handling-no-sub-command-with-argparse

results matching ""

    No results matching ""