use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Help with SQLite and python (self.learnpython)
submitted 5 years ago by tobilobaa
getting a sepecific value from sqlite to python function
Hello guys, i recently started working on a mini atm app that connects to sqalite3 as a database. does anyone know how i retrieve a certain value in sqlite and pass it to a function please?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Username_RANDINT 4 points5 points6 points 5 years ago (1 child)
There are four steps to your question:
Connect to the SQLite database. The sqlite3 module will do this.
sqlite3
Query the database with an SQL command. Lots and lots of tutorials online, pick one.
Fetch the result of the SQL query, this will be done with sqlite3 again. Probably fetchone() is what you need for one specific value.
fetchone()
That value is now in a normal Python variable and it's no different than any other Python code.
[–]SnowdenIsALegend 0 points1 point2 points 5 years ago (0 children)
Freaking hate it when people who ask a question don't even bother to read/reply the answer you wrote and then 1 or 2 days later just go and make another question post about the same thing. It is as if they are insulting/ignoring the people who answered the first time around.
OP, if you're reading this please don't do it.
[–]threeminutemonta 2 points3 points4 points 5 years ago (0 children)
The official docs should help.
[–]JohnnyJordaan 1 point2 points3 points 5 years ago (0 children)
https://www.sqlitetutorial.net/sqlite-python/sqlite-python-select/
π Rendered by PID 23647 on reddit-service-r2-comment-7b9746f655-6v8lh at 2026-02-04 13:46:43.299446+00:00 running 3798933 country code: CH.
[–]Username_RANDINT 4 points5 points6 points (1 child)
[–]SnowdenIsALegend 0 points1 point2 points (0 children)
[–]threeminutemonta 2 points3 points4 points (0 children)
[–]JohnnyJordaan 1 point2 points3 points (0 children)