#π Im creating my own Database module in python but when i read a file it comes back as None
22 messages Β· Page 1 of 1 (latest)
@peak wyvern
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
whats the output
None
well of course
you're not returning anything
from your read function
so it'll return None
How can i update the variable "Content" to send back over to the user?
so you want the variable Test to have the values of Content?
Ye so what it is is you send over the key which is connected to a file and when you send that DB.Read(Key = "testKey"), the Module looks for that key in its data folder and reads what is connected in that key (Which should output as "Test") but im not sure how to send what the Content of that key is back to the test.py
in your read function change the last line from return to return Content
Damm that worked Thank you so much man ive been trying to work that out for a while and all it was was that 1 word lol I apprecite it
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.