Yes, I have almost the same; the difference being I have the quotes the other way around:
c.execute(f"SELECT * FROM '{table_name}'")
… the reason being, I seem to recall that SQL statements are case sensitive (on Linux systems, least ways) and although this is not SQL and will most likely never be ported to said, I feel it’s best to be in keeping with that format.
Thanks for the info and tips; I’ve learned more from this project than I expected to.
Edit: hummm, it’s just occurred to me, what I just typed “… case sensitive…” has nothing to do with the quotes. Lack of sleep is fogging my mind.
Keywords (like SELECT) and identifiers are case-insensitive in SQL.
In general there should not be differences depending on the platform the SQL is running on but there are differences between SQL dialects. It is good that SQLite tries to follow ANSI SQL.
Edit: In the citation from the SQLite documentation I changed the confusingly used word “keyword” for “text”.
IIRC, the SQL standard requires column and table names to be double-quoted, not single-quoted. SQLite will accept both forms, though, but such a query may fail with other database engines, so using double-quotes is good practice. Also note that string literals should be single-quoted. The latter is more important, since SQLite can be compiled with for example -DSQLITE_DQS=0.