表格储存

import os
from tablestore import *
import time

OTS_ID = "ID"
OTS_SECRET = "SEC"
OTS_ENDPOINT = "ENDPOINT"
OTS_INSTANCE = "NAME"
#OTS_STS_TOKEN = os.getenv('OTS_TEST_STS_TOKEN')

table_name = 'visitor_count'
primary_key = [('urls', '/1/1/1')]
columns_to_get = ['numbers']

client = OTSClient(OTS_ENDPOINT, OTS_ID, OTS_SECRET, OTS_INSTANCE)

consumed, return_row, next_token = client.get_row(table_name, primary_key, columns_to_get)
if return_row != None:
    print(return_row.attribute_columns[0][1])

函数计算

from flask import Flask, request

app = Flask(__name__)

@app.route('/', methods=['GET'])
def register():
    #a = request.args.get("1")
    b = str(request.referrer)
    return b

if __name__ == '__main__':
    app.run()
最后修改:2020 年 12 月 06 日 03 : 45 PM
如果觉得我的文章对你有用,请随意赞赏!