【原創】python學習筆記(5)--《笨辦法學python》,指令碼帶引數
一 指令碼檔案
(1) 簡單的說就是一段自己寫的,可執行的程式碼,否則會報錯
(2)簡單指令碼,直接 python xxx1.py
(3)帶引數指令碼,需要 python xxx2.py argv1 argv2 argv3
根據指令碼引數的數量,傳入對應的引數,空格分隔即可,否則會報錯,無法解包unpack
# -*- coding:utf-8 -*- from sys import argv script,first,second,third=argv print "the script is called:" ,script print "the first var is :" ,first print "the second var is :" ,second print "the third var is :" ,third
相關推薦
【原創】VBA學習筆記(2)--例項,VBA刪除表中的空行
Sub 巨集1迴圈內刪列() '資料不規範,有的空行是4,有的是6,有的是1就不好處理了 For i = 15 To 100 Step 2 Rows(i).Delete Shift:=xlUp &nb
【原創】pygame學習筆記(4)----一個打飛機遊戲
根據資料學習,程式碼是在資料的基礎上,重新打的,有部分修改。 轉載資料來源:-will https://www.cnblogs.com/wuzhanpeng/p/4261015.html http://eyehere.net/2011/python-pygame-n
【原創】pygame學習筆記(3)--triviagame答題遊戲
一 容易出錯的地方 def _init_(self,name,score) 要記住, __init__ 前後都是兩個下劃線,而不只是1個下劃線 二 程式碼測試 顯示效果正常了,可以玩了 現在題目會迴圈玩 # -*- coding:utf
【原創】pygame學習筆記(2)----pie遊戲(需優化)
測試程式碼情況 (1)做到了弧形可以按出來 (2)數字的顯示正確 (3)出的一些低階錯誤 temp:\\pygame2.txt 這樣的錯誤, temp\\pygame2.txt 導致 這樣的錯誤,
【原創】pygame學習筆記(1)----基本的線,矩形,圓形,弧形繪製
PYgame的內容 (1)這個module很有意思 (2)書本至少來源於《Python遊戲程式設計入門》 (3)官方權威說明:https://www.pygame.org/docs/ 下面的嘗試把各種圖形在一個程式裡繪製 注意點: (1)特別注意,比如引
【原創】python學習筆記(5)--《笨辦法學python》,指令碼帶引數
一 指令碼檔案 (1) 簡單的說就是一段自己寫的,可執行的程式碼,否則會報錯 (2)簡單指令碼,直接 python xxx1.py (3)帶引數指令碼,需要 python xxx2.py argv1 argv2 argv3 根據指令碼引數的數量,
【整理】python學習筆記(5)-- pygame庫的函式和方法整理
PYGAME的方法和官方文件查詢 官方文件 http://www.pygame.org/docs/ 模組 簡介 pygame.BufferProxy An array protocol view
【轉】Nodejs學習筆記(一)--- 簡介及安裝Node.js開發環境
ack 目錄 javascrip 難度 時間 網站開發 clas jetbrains 常用 目錄 學習資料 簡介 安裝Node.js npm簡介 開發工具 Sublime Node.js開發環境配置 擴展:安裝多版本管理器 學習資料 1.深入淺出Node.j
【mxGraph】原始碼學習:(5)mxGraph
由於mxGraph原始檔有一萬多行,且涉及很多其它原始檔,所以重點在於瞭解mxGraph的作用、結構以及定義了哪些方法 1. 概覽 1.1 作用 mxGraph繼承自mxEventSource以實現基於Web的圖形元件的功能性方面。要啟用平移和連線,使用se
【Docker】Docker學習筆記(一)Docker基礎
1 Docker簡介 開發語言:Go 性質:作業系統層面的虛擬化技術 Docker 和傳統虛擬化方式的區別: 傳統虛擬機器技術是虛擬出一套硬體後,在其上執行一個完整作業系統,在該系統上再執行所需應用程序 容器內的應用程序直接運行於宿主的核心,
Python學習筆記(5)--類相關語法
1.呼叫父類方法 super(SubClassName, self).__init__(args) super(SubClassName, self).method(args) 2.私有元素 新增'_'字首 3.python描述符 描述符用來自定義在引用一個物件上的特性
【Flask】Flask學習筆記(一) 應用基本結構
route windows 數字 browser 基本結構 主程序 web瀏覽器 ive app 初始化 使用前必須創建一個應用實例 from flask import Flask app = Flask(__name__) 路由和視
Docker學習筆記-(5)容器數據管理,鏈接容器,構建私有庫
控制 st2 容器數據 pan 備份文件 data- 否則 所有 連接 五、容器數據管理,鏈接容器,構建私有庫 ① 容器數據管理 docker管理數據的方式有兩種: 數據卷 數據卷容器 1. 數據卷 數據卷是一個或多個容器專門指定繞過Union File System的
Python學習筆記(三):pip安裝方法,import相關用法
就當是記個筆記了。這是Linux系統下的pip安裝方法: pip安裝方法 一: get http://python-distribute.org/distribute_setup.py sudo python distribute_setup.py
【原創】python學習筆記(10)--《笨辦法學python》字串處理
字串基本操作 (1) 字串+字串 (2)字串*數字 (3)字串+str(其他) # -*- coding:utf-8 -*- print ("test1") name1="alice" name2="bob" name_new=name1+name2 print
【原創】python學習筆記(8)--《笨辦法學python》關於list列表
一 列表,元組 和字典的概念 二 列表的各種方法 .append() .insert() .sort() .reverse() .index() .count() .remove() # -*- coding:utf-8 -*- #先看下list 再
【python學習筆記(2)】指令碼報錯"AttributeError: 'module' object has no attribute 'xxx'"解決方法
最近在編寫Python指令碼過程中遇到一個問題比較奇怪:Python指令碼完全正常沒問題,但執行總報錯"AttributeError: 'module' object has no attribute 'xxx'"。這其實是.pyc檔案存在問題。 問題定位: 檢視imp
【Java】「深入理解Java虛擬機」學習筆記(5)- 類加載
一次 some img 不同的 各路 轉換 準備 自己 綁定 C/C++在編譯時需要進行連接,而Java的類加載、連接和初始化是在運行時完成的。 圖 類的生命周期 圖中解析的過程不一定在準備和初始化之間,也可以在初始化之後再開始,以支持Java
【轉】Python3學習筆記(urllib模塊的使用)
nal 方法 utf 網址 pin des IE tps erer 原文地址:https://www.cnblogs.com/Lands-ljk/p/5447127.html 1.基本方法 urllib.request.urlopen(url, data=None, [ti
Python時間序列LSTM預測系列學習筆記(5)-單變數
本文是對: https://machinelearningmastery.com/time-series-forecasting-long-short-term-memory-network-python/ https://blog.csdn.net/iyangdi/article/deta