python - PTable 中的箭头导航
问题描述
我正在为学校制作一个关于汽车数据库的项目。我使用模块 PTable 来显示汽车,我想知道我是否可以以及如何使用诸如questionary之类的东西来选择将要删除的汽车,并带有箭头导航:
questionary.select(
"What car do you want to remove?",
choices=[
*table goes here i asume*
]).ask()
我该怎么办?
这就是我现在拥有的:
cur = cursor.execute("SELECT id, brand, price, year, licensePlate, isLeasingCar from cars")
t = PrettyTable(["ID", "Brand", "Price [kr.]", "Year", "License plate", "Is car leased?"])
for row in cur:
if row[5]:
leasing = "Ja"
else:
leasing = "Nej"
t.add_row([row[0], row[1], row[2], row[3], row[4], leasing])
print(t)
questionary.select(
"What car do you want to remove?",
choices=[
]).ask()
我使用:从漂亮表导入问题导入漂亮表
解决方案
推荐阅读
- struct - Google Bigquery 上的聚合聚合
- java - 如何添加新玩家?
- node.js - EACCES:通过 Microsoft Azure 部署 node.js Web 应用程序时权限被拒绝
- reactjs - 使用 Apollo 和 Graphql(serius 项目)为 Reacjs 提供一些架构建议?
- c# - 使用 WMI 列出映射的网络驱动器
- neural-network - 使用 ReLU 进行反向传播 - 理解计算
- julia - 语法“|>”在 Julia 中有什么作用?
- corda - 构建 Corda 示例项目时出现 log4j 错误
- javascript - 如何在 Firebase Firestore 完成之前暂停 Javascript MAP?Promise、Async/Await 或两者兼有
- node.js - 如何在没有守卫装饰器的情况下始终验证 JWT?(Nest.js + 护照)