You are viewing a single comment's thread from:

RE: Your 1st Python Hive Bot Deployment

in #dev2 months ago

Here's a good video on error handling in Python.

A very well done video: do you use or reccomend using Merry? Also, the concept of bringing errors to the higher scope looks cool and it helped me understanding a bit more the use of "raise". Not that I am now able to implement it in my code, but at least I have a new concept I can try to (slowly) make mine.

SQLAlchemy

This is something I have to start studying, because you mentioned databases so many times and I don't know anything about them... and this is starting to be a problem too big to keep ignoring it.

Btw, in the snippet you shared, what is the signal that interrupts the script changing the boolian value False to True? An input from the coder?

Sort:  

what is the signal that interrupts the script

SIGINT (interrupt signal) is a predefined signal-> it's Ctrl + C
The way I use it ensures, that the program finishes thing() before exiting.
What SIGINT stands for was explained in the example I linked a line above my code...
It was confusing me too, when I first saw it: I thought SIGINT was some sort of integer.

do you use or recommend using Merry?

No XD

SQLAlchemy

This is something I have to start studying

It's really worth looking into. My SQL is ass. But I understand (for the most part) what SQL does and that's kinda important.
SQLAlchemy isn't necessary to use SQL, but makes it neater Python code.
I'll write a big long series about how I build things and why and I'll be using it, and once you touch flask and flask tutorials (by the same guy I linked the error video from) you can't avoid it.

I am not using SQL because it is fast (which it is), but mainly because the built in serialization saves me so much work. It's also easy to backup.

snippet you shared

I've thought about and edited the post above.
I now recommend this video:

SIGINT (interrupt signal) is a predefined signal-> it's Ctrl + C

I've seen that it's also in your snippet, but yesterday I somehow only red "can't...", and not "CTRL + C can't..."... nice, I'm blind 😅

I now recommend this video:

I think I might drop a follow to this guy: he has a lot of undervalued content I have to check!

yesterday I somehow only red "can't...", and not "CTRL + C can't..."...

Yesterday it said that. I edited it after replying to you earlier.

I think I might drop a follow to this guy: he has a lot of undervalued content I have to check!

He's got the best flask guide. Not in videos, but on his homepage.
When I first found it, I didn't really get it, because it's more targeted at people, who already tried doing the same things in other languages/libs or by themselves.