t.py 656 B

1234567891011121314151617181920212223242526272829303132
  1. import Stateful
  2. def MatchTomlTable(tomlName, tableName, returnType="list"):
  3. d = Stateful.GetTomlDoc(tomlName).unwrap()
  4. if returnType == "list":
  5. return list(d.get(tableName).values())
  6. elif returnType == "dict":
  7. return d
  8. def add(args=[]):
  9. table = "Class"
  10. v1 = MatchTomlTable(tomlName, 'Class')[1:]
  11. sqls = "INSERT INTO {table} VALUES({values})".format(table=table, values=sqls_v)
  12. # res = Stateful.Exec_one(dp, sqls)
  13. print(sqls)
  14. if __name__ == "__main__":
  15. tomlName = "dev_config.toml"
  16. dp = "dev.db"
  17. # res = MatchTomlTable(tomlName, "Board")
  18. res = add()
  19. print(res)