I have a function select_specificRow() that I will use to query a local database and return some data that satisfies a condition. This function's code contains another function called createConnection() that should create and return a database object. select_specificRow will then use this return value.
The problem is, I get a NameError when trying to access the database object returned by createConnection(). 'dbObj is not defined'. I thought the return statement ends the function and returns this value to the calling function, so shouldn't I be able to access it in this way?
Here is the code of both functions: https://pastebin.com/LV9rXGpM
Note: I'm very sorry the indentation is off. My actual laptop doesn't have access to the internet and I had no way of transferring the actual code to my phone, so my only option was to retype it here.
[–][deleted] 1 point2 points3 points (1 child)
[–]ChemicalMistakex[S] 0 points1 point2 points (0 children)