3
我試圖創建一個程序,檢查我的谷歌日曆,當我在工作,是否超時或正常率,然後計算我應該支付那個月的金額。我已經閱讀了谷歌API參考,但我沒有運氣。這裏是我的僞代碼:我如何找到兩個事件之間的時間差使用谷歌日曆API python
Get events for month
Write events to file split each value with comma
Check each event for keyword work else remove from file
For each line check amount of hours worked and append to end of line
If day = Sunday or event name = work (Overtime BH) append value to BankHolidayHours Variable
If day = Thursday or Saturday append value to ContractedHours variable
Else write to OvertimeHours variable
BankHolidayTotal = BankHolidayHours * BHRate
ContractedHoursTotal = ContractedHours * CHRate
OvertimeHoursTotal = OvertimeHours * OHRate
Print OvetimeHoursTotal & ContractedHoursTotal & BankHolidayTotal to screen
任何幫助將非常感謝。
向我們建議向您展示您的某個活動在API中的「外觀」。還提供了Python僞代碼,並指出代碼中它不工作的地方是「我沒有運氣」,只是要求關閉這個問題。 – wescpy