我有这样的代码从数据库中检索数据,我想在html中显示它.
这是app.py
@app.route('/news')
def news():
import pymysql
import re
host='localhost'
user = 'root'
password = ''
db = 'skripsi'
try:
con = pymysql.connect(host=host,user=user,password=password,db=db, use_unicode=True, charset='utf8')
print('+=========================+')
print('| CONNECTED TO DATABASE |')
print('+=========================+')
except Exception as e:
sys.exit('error',e)
cur = con.cursor()
cur.execute("SELECT * FROM dataset")
data = cur.fetchall()
for row in data:
id_berita = row[0]
judul = row[1]
isi = row[2]
print('===============================================')
print('BERITA KE', id_berita)
print('Judul :', judul)
print('Isi :', isi)
print('===============================================')
return render_template('home.html')
Run Code Online (Sandbox Code Playgroud)
这是结果
这是berita.html.我想在div class = …
任务:
问题:
Python函数
def detect_logos(path):
"""Detects logos in the file."""
client = vision.ImageAnnotatorClient()
# [START migration_logo_detection]
with io.open(path, 'rb') as image_file:
content = image_file.read()
image = types.Image(content=content)
response = client.logo_detection(image=image)
logos = response.logo_annotations
print('Logos:')
print(logos)
print(type(logos))
Run Code Online (Sandbox Code Playgroud)
Google在线JSON
"logoAnnotations": [
{
"mid": "/m/02wwnh",
"description": "Maxwell House",
"score": 0.41142157,
"boundingPoly": {
"vertices": [
{
"x": 74,
"y": 129
},
{
"x": 161,
"y": 129
},
{
"x": 161,
"y": 180
},
{
"x": 74,
"y": 180 …Run Code Online (Sandbox Code Playgroud) 我已经使用"pip install'library name'"命令在我的计算机和其他库上成功安装了pip.我得到了我的项目所需的所有库,除了"线程"!我在网上找不到任何关于它的东西,并且问其他人没有人可以提供帮助.任何帮助都很感激.我有Python 2.7.9版本.
这是我得到的错误
我正在做一个简单的任务。代码已经可以运行了。以下是步骤:
使用这篇文章: https: //stripe.com/docs/checkout/integration-builder
从 UI 购买门票
在后端创建结帐会话并传递所需的数据。这些都工作正常。
const session = await this._stripe.checkout.sessions.create({
payment_method_types: ['card'],
customer_email: email,
line_items: [
{
price_data: {
currency: ###,
unit_amount_decimal: ###,
product_data: {
name: ###,
description: ###
}
},
quantity: 1
}
],
payment_intent_data: {
on_behalf_of: ###,
transfer_data: {
destination: ###,
amount: ###
},
metadata,
statement_descriptor: ###
},
mode: 'payment',
success_url: successUrl,
cancel_url: cancelUrl
});
Run Code Online (Sandbox Code Playgroud)
代码工作正常,我能够完成付款,并且它会通过元数据和其他字段反映到我的主帐户中。
问题:我希望将相同的元数据存入我正在转账的连接帐户中,以便我们可以共享相同的元数据。连接/目标帐户内有一个关于付款的元数据部分。这就是我想添加这些细节的地方。还有什么我需要更新的,比如收费或转账之类的?我尝试更新传输,但它们都没有将元数据反映到目标帐户中。
我应该在哪里添加哪些参数才能将元数据添加到我的连接帐户中?任何帮助都会很棒。谢谢