我這個項目的碼雲地址是https://gitee.com/chitu_heshui/personal_project41678.git
表格記錄了我預期做這個項目的時間和實際上消耗的時間
| PSP2.1 | Personal Software ProcessStages | 預估耗時(分鍾) | 實際耗時(分鍾) |
| Planning | 計划 | 440 | 410 |
| Estimate | 估計這個任務需要多少時間 | 440 | 410 |
| Development | 開發 | 200 | 180 |
| Analiysis | 需求分析(包括學習新技術) | 30 | 20 |
| Design Spec | 生成設計文檔 | 20 | 15 |
| Design Review | 設計復審 | ||
| Coding Standard | 代碼規范(為目前的開發制定合適的規范) | 20 | 15 |
| Design | 具體設計 | 20 | 20 |
| Coding | 具體編碼 | 60 | 70 |
| Test | 測試(自我測試,修改代碼,提交修改) | 30 | 30 |
| Reporting | 報告 | ||
| Test Repor | 測試報告 | ||
| Size Measurement | 計算工作量 | ||
| Postmortem & Process Improvement Plan | 事后總結,並提出過程改進計划 | 60 | 60 |
| 合計 | 440 | 410 |
計算器的流程圖

寫這個計算器的時候遇到了正則表達式來判斷輸入的值,這是上學期在數據結構學到的但是忘了,所以就在百度上找了一些博客來學習,
還有就是加減乘除出運算時處理的函數也是在百度上找的,自己研究了好久,挺好玩的,
這是從命令提示行獲取代碼:
parser=argparse.ArgumentParser(description='Process some inteqers.')
parser.add_argument("one",type=str)
args=parser.parse_args()
String = args.one
這是運算的部分代碼:
def getValue(exp):
def value(exp, i):
deque = []
pre = 0
while i < len(exp) and exp[i] != ')':
if ord(exp[i]) >= ord('0') and ord(exp[i]) <= ord('9'):
pre = pre * 10 + int(exp[i])
i += 1
elif exp[i] != '(':
addNum(deque, pre)
deque.append(exp[i])
i += 1
pre = 0
else:
bra = value(exp, i + 1)
pre = bra[0]
i = bra[1] + 1
addNum(deque, pre)
return [getNum(deque), i]
這是正則判斷的代碼:
jisuan=re.compile("^(\(*\d+(.\d+)*\)*(\+|-|/|\*))+\d+(.\d+)*\)*$")
程序會獲取從命令行輸入的字符串並將其從命令行窗口顯示出來

我遇到了一個問題就是test測試的時候定義方法名字的時候必須要以test_開頭,否則就不會測試,測試用例,這個坑我踩了好久

總結:通過大偉老師安排我軟件工程這門課,深深體會到有些東西必須得經歷的,就是(趟坑)坑踩多了就好了,這是一個過程,使得我們如何快速的解決問題,要養成良好的編程習慣。
