PyCharm

install(windows)

  • download PyCharm windows Community version

create new project for all reference(pythonProject-home)

選擇 New Project

建立 reference projectw

Shift-F10 執行

create new project

選擇 New Project

建立 projectw

可選擇蓋掉原本視窗(This Window) 或 建立新視窗(Ne Window)

刪除 project 環境, venv 目錄(避免一直建立執行環境)

更改執行環境的位置(pythonProject-home)

<

Shift-F10 執行

python 100 days code save to GitHub

git init + add .gitignore

1
2
3
4
5
# git init 
cd python_100ds
git init
# create .gitignore
git init

add file and commit

1
2
git status
git commit -m "first commit"

push code to GitHub

GitHub repository 要先建立

1
2
git remote add origin https://github.com/hot5656/python_100ds.git
git push -u origin master

PyCharm feature

Spell Check

分割視窗

檔案標題按 mouse 右鍵 –> Splite Right

Style Guide for Python

PEP 8 – Style Guide for Python Code

Show file history

  • File –> Local History –> Show History
  • Recover : 按 icon for Revert

變數改名

  • 選擇變數 –> 滑鼠右鍵 –> Refacor –> Rename

  • 輸入更改內容 –> 按 Preview

  • 看一下更改位置 –> 按 Do Refactor

Code 整理

Code –> Reformat Code

找 function source 位置

Go To –> Implementation

Insatll Python Package

  • File –> Setting

  • Project Interpreter –> +

  • Input Module Name –> Install Package

快捷鍵(Hot Key)

Debug

1
2
3
4
5
6
Shift+F10 : Run main
Shift+F9 : debug Run main
F7 : Setp In
F8 : Step out
F9 : debug 繼續執行
Ctrl+F8 : toggle the breakpoint.

Edit

1
2
3
4
5
Ctrl+F									: basic search
Alt+F7 : find usages
Alt+Shift+(up/down) : 程式上移或下移
Double Shift : search all files
click+Alt+shift 往下拉 : 多行編輯