简体   繁体   English

Python SQLite3 - 将许多变量存储到表中

[英]Python SQLite3 - Storing many variables into table

What I am trying to do is keep track and have access to a list of users from discord, based on mentions.我要做的是跟踪并访问 discord 的用户列表,基于提及。

An example is if the mentioned user I am checking discord name = user#0001一个例子是,如果我正在检查提到的用户 discord name = user#0001

users who mentioned user#0001提到 user#0001 的用户

user#1111 user#2222 etc.用户#1111 用户#2222 等

I want to store the mentioned user(user#0001), as well as each user who mentioned that person.我想存储提到的用户(user#0001),以及提到那个人的每个用户。

But what I am not understanding is how I could do this in SQlite, when the amount of users mentioning another user, will be different for everyone.但我不明白的是我怎么能在 SQlite 中做到这一点,当提到另一个用户的用户数量会因人而异。 Some may have 1 or 2, some may have 50 or 60.有些可能有 1 或 2 个,有些可能有 50 或 60 个。

What would be the best way for me to keep track of this, while having easy access to it?对我来说,在轻松访问它的同时跟踪它的最佳方式是什么? Right now, I am doing this from.txt file, but I'd rather do another way if I can that would allow better access.现在,我正在从.txt 文件中执行此操作,但如果可以的话,我宁愿采用另一种方式,这样可以更好地访问。

Here.这里。 python + sqlite, insert data from variables into table A similar question. python + sqlite, insert data from variables into table类似的问题。 I know sometimes it's really annoying when your code doesn't work, but search it up here at stack overflow or at google.我知道有时当你的代码不起作用时真的很烦人,但是在堆栈溢出或谷歌上搜索它。 I hope you enjoy your stay at overflow!希望您在overflow过得愉快!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM