程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python-Level1-day01: Industry Interpretation; Relevant Preface; Environment Construction; Introduction to Python

編輯:Python

 

教學理念 理念一:弱語法,focus on essence It is a weakened language rule,A learning process that focuses on the principles of programming. Grammar is representation,Only understand the underlying mechanism,才能靈活運用. Learning to program involves going deep into memory,剖析原理,to see the grammar. Like Tai Chi“用意不用力,First in the heart and then in the body”的道理. 理念二:是技術,更藝術 編程是一門技術,But it is more of an art. 寫出高質量的代碼(功能性、維護性,靈活性),Have fun with programming. 理念三:項目化,實戰化 2048 The core algorithm runs through Python 核心. The epidemic information management system runs through object-oriented. The integrated operational framework runs through Python 高級. The second-hand housing information management system runs through the whole stage.學習方法 第一步:Notes must be organized for the day The process of sorting through what you have learned that day. Prevent future troubles caused by forgetting and confusion. 將理論,代碼,Three in one icon. 第二步:Practice must be done on the day Class presentations are seen with the eyes demo01、demo02 … Class practice hands-on knocking exercise01、exercise02 … It can be done independently. 第三步:Knowledge of the day must be understood What 是什麼,That is, to understand the definition of knowledge points. Why 為什麼,That is, understanding the role of knowledge points. Where 在哪裡,That is, understanding the applicability of knowledge points. How 如何使用,That is, to understand the grammar of knowledge points. Python 簡介 計算機基礎結構 硬件1944 年,美籍匈牙利數學家馮·諾依曼提出計算機基本結構. 五大組成部分:運算器、控制器、存儲器、輸入設備、輸出設備.-- 運算器:按照程序中的指令,對數據進行加工處理. -- 控制器:根據程序需求,指揮計算機的各個部件協調工作. 通常將運算器和控制器集成在中央處理器(CPU)中. -- 存儲器:保存各類程序的數據信息. 內存 RAM -- 容量小,速度快,臨時存儲數據 硬盤 HDD -- 容量大,速度慢,永久存儲數據 輸入設備:外界向計算機傳送信息的裝置. 例如:鼠標、鍵盤、掃描儀… 輸出設備:計算機向外界傳送信息的裝置. 例如:顯示器、音響、打印機…軟件操作系統: -- 管理和控制計算機軟件與硬件資源的程序. -- 隔離不同硬件的差異,使軟件開發簡單化. -- Windows,Linux,Unix. 應用軟件:為了某種特定的用途而被開發的軟件. 軟件:程序 + 文檔. -- 程序是一組計算機能識別和執行的指令集合. -- 文檔是為了便於了解程序所需的說明性資料.基礎知識 Python 定義 是一個免費、開源、跨平台、動態、面向對象的編程語言. Python 程序的執行方式 交互式在命令行輸入指令,回車即可得到結果. 1. 打開終端 2. 進入交互式:python3 3. 編寫代碼:print(“hello world”) 4. 離開交互式:exit() 文件式將指令編寫到.py 文件,可以重復運行程序. 1. 編寫文件 2. 打開終端 3. 進入程序所在目錄:cd 目錄 4. 執行程序: python3 文件名 Linux 常用命令 1. pwd:查看當前工作目錄的路徑2. cd:改變工作目錄(進入到某個目錄) 練習:1. 在指定目錄創建 python 文件. --目錄:/home/tarena/month01 --文件名:exercise01.py 2. 在文件中寫入:print(“你好,世界!”) 3. 運行 python 程序 執行過程 計算機只能識別機器碼(1010),不能識別源代碼(python). 1. 由源代碼轉變成機器碼的過程分成兩類:編譯和解釋. 2. 編譯:在程序運行之前,通過編譯器將源代碼變成機器碼,例如:C 語言. -- 優點:運行速度快 -- 缺點:開發效率低,不能跨平台. 3. 解釋:在程序運行之時,通過解釋器對程序逐行翻譯,然後執行.例如 Javascript -- 優點:開發效率高,可以跨平台; -- 缺點:運行速度慢. 4. python 是解釋型語言,但為了提高運行速度,使用了一種編譯的方法.編譯之後 得到 pyc 文件,存儲了字節碼(特定於 Python 的表現形式,不是機器碼). 源代碼 -- 編譯 --> 字節碼 -- 解釋 --> 機器碼 |————1 次———|解釋器類型 1. CPython(C 語言開發) 2. Jython (java 開發) 3. IronPython (.net 開發)
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved