底下用就用 checkIO ATM + Google GAE(guestbook) 來當今天的玩具好了. 主要改寫 checkIO ATM 的 input/output parts 跟 GAE 的 db handle 部分. 除了可以練習一下 GAE,也可以玩 checkIO 裡的習題.
input : Web text form
output : results
output : results
def checkio_atm(data):
try:
data = str(data).replace(' ','').replace('[','').replace(']','')
datas = [int(d) for d in data.split(",")]
balance, withdrawal = datas[0], datas[1:-1]
for a in (0.5 + 1.01*it for it in withdrawal if it %5 ==0):
balance = floor(balance - a) if balance > a else balance
return "input = %s, rst = %s" %(data,str(balance))
except:
return "CheckIO ATM Error"
GAE key notes- python
- python 2.5 python2.7
- data store
- GQL
- protocol
- WSGI
- env config set
- yaml
- How to use ?
- sample code
Html key notes
- css
- html embedded query

沒有留言:
張貼留言