uploading chapter 9 source code

This commit is contained in:
muassif
2021-06-15 23:10:30 +04:00
committed by GitHub
parent ac10d74a74
commit 360b7f1420
10 changed files with 259 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
runtime: python39
+30
View File
@@ -0,0 +1,30 @@
from flask import Flask
from datetime import date, datetime
# If `entrypoint` is not defined in app.yaml, App Engine will look for an app
# called `app` in file `main.py`. This is the case in our yaml file
app = Flask(__name__)
@app.route('/')
def welcome():
return 'Welcome Python Geek! Use appropriate URI for date and time'
@app.route('/date')
def today():
today = date.today()
return "{date:" + today.strftime("%B %d, %Y") + '}'
@app.route('/time')
def time():
now = datetime.now()
return "{time:" + now.strftime("%H:%M:%S") + '}'
if __name__ == '__main__':
# For local testing
app.run(host='127.0.0.1', port=8080, debug=True)
+1
View File
@@ -0,0 +1 @@
Flask==2.0.1