[SOLVED] Python: executes without errors or warnings, but data is not inserted in SQLite database
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The main problem it has is the formatting chosen for the source lines that insert the data in the database. It has the issue isolated and shown in this separate thread: Python syntax problem?. Specifically, the main problem is in the lines:
Because there is no "" in the end of the line 133, this line is valid, but does nothing. The lines 134-137 are also valid, and they are separated from 133, but also do nothing.
This is where pylint can definitely help. It won't be able to tell you what is the correct solution, but will be able to tell you the code does nothing. If you wish you can check it again.
This is where pylint can definitely help. It won't be able to tell you what is the correct solution, but will be able to tell you the code does nothing. If you wish you can check it again.
It told me the code did not do anything, but without any explanation. So, I considered this statement wrong, and proceeded to other things pylint told.
It told me the code did not do anything, but without any explanation. So, I considered this statement wrong, and proceeded to other things pylint told.
It told me the code did not do anything, but without any explanation. So, I considered this statement wrong, and proceeded to other things pylint told.
The fact that the code does nothing is the explanation. Your conclusion that the message was wrong was... wrong.
Debugging tools do their best to identify problems and bring them to our attention. Usually problems are identified when a parser, or tool, cannot proceed or has a set of symbols it cannot resolve within its current context. The point where that happens can be far from the actual error which causes it, and there may be many possible errors which could produce the same problem, so it is not always possible for the tool to identify the specific cause in any given case.
In this case, it told you that the block of code had no effect - it doesn't do anything - and you are expected to know what you intended for it to do and how it should do so, and to figure out why it does not, in fact, work. It was not possible for it to tell you exactly why it did nothing. If that were the case it could simply fix it for you and continue!
Learn to trust the messages produced by your tools and to understand why any given message was produced. In the occasional case where a message may be superfluous, you should still be able to identify why it was produced!
To find what solves errors/warnings is easy. Detailed explanation, I am not sure. Does the link you point explain things like what people did in this thread? (I did not check for the case we are discussing because I am want to know more about possible future uses of that link, compared to other search results I can find)
The fact that the code does nothing is the explanation. Your conclusion that the message was wrong was... wrong.
Debugging tools do their best to identify problems and bring them to our attention. Usually problems are identified when a parser, or tool, cannot proceed or has a set of symbols it cannot resolve within its current context. The point where that happens can be far from the actual error which causes it, and there may be many possible errors which could produce the same problem, so it is not always possible for the tool to identify the specific cause in any given case.
In this case, it told you that the block of code had no effect - it doesn't do anything - and you are expected to know what you intended for it to do and how it should do so, and to figure out why it does not, in fact, work. It was not possible for it to tell you exactly why it did nothing. If that were the case it could simply fix it for you and continue!
Learn to trust the messages produced by your tools and to understand why any given message was produced. In the occasional case where a message may be superfluous, you should still be able to identify why it was produced!
Yes. I am learning to use this new tool, pylint, as I am learning the basics of Python. Thank you for these comments, astrogeek.
To find what solves errors/warnings is easy. Detailed explanation, I am not sure. Does the link you point explain things like what people did in this thread? (I did not check for the case we are discussing because I am want to know more about possible future uses of that link, compared to other search results I can find)
Ok, that is a general page, not for you, not for me, just a general description about what was found. You not only need to understand why it was reported, but you have to know if that was intentional or actually something went wrong.
In this case I can suggest you to post the exact message you got and I will try to explain how should it be handled. (again, in general you need to enter the code - or type - of that message, which is something like W0345 and it will give a special explanation for that, what the authors think about that case).
Ok, that is a general page, not for you, not for me, just a general description about what was found. You not only need to understand why it was reported, but you have to know if that was intentional or actually something went wrong.
In this case I can suggest you to post the exact message you got and I will try to explain how should it be handled. (again, in general you need to enter the code - or type - of that message, which is something like W0345 and it will give a special explanation for that, what the authors think about that case).
If I knew pylint before starting this thread, I would have understood the other things it pointed in my code. My question would contain only the lines I copied in the post #30, which is the post where I joined everything that solved this thread. So, if more Python help is needed, and information around the web does not help enough, I should write a better question, possibly much smaller and direct.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.