« first day (3670 days earlier)      last day (1282 days later) » 
06:00 - 21:0022:00 - 00:00

10:14 PM
i can't seems to apply try except inside thread. the thread stuck forever
 
Ok. That doesn't seem a particularly constructive statement. Are you asking the room for help? If so, what do you want help with? As it stands, it's just a statement
 
@lone_coder For coding questions, it helps to have an example piece of code that we can talk about concretely.
 
i do ask for help. i can't put try except inside QThread. whenever exception is occur. the thread wont finished
 
Please give a code example to illustrate the problem.
 
10:33 PM
if I copy the code here. all indentations are gone. so I'm gonna put it right here codeshare.io/5Mdbwq
whenever the class object called. if there's no exception. there's no problem. but whenever exception occurs. the thread somehow still holding on. so that in the end whenever I closed the program the thread is still running
or is that how thread supposed to be? . it keeps going whenever an exception occurs? or is it just me who implement it wrong?
if i tried to give it a condition. only 10 calls are made per second. it finishes about 15 seconds later no less. so if I had 100 calls it would've been much worse
 
@lone_coder please see the formatting guide and practice in the sandbox linked there if necessary
 
i used backtick but the identations are gone
 
Which is why you should read the guide
 
@lone_coder you've been in the sandbox from the start. You can practice there once you've read the guide carefully.
 
ctrl + k right?
 
10:48 PM
@lone_coder :|
 
class CheckConnection(QtCore.QThread):
    result = QtCore.Signal(str)
    def __init__(self, parent,engine):
        QtCore.QThread.__init__(self, parent)
        self.engine = engine
    def run(self):
        try:
            self.engine.execute('SELECT 1').fetchall()
            self.result.emit("Connected")
        except:
            self.result.emit("Not Connected")
            return
        self.deleteLater()
 
Please only post code here once you're sure it will be formatted correctly
@lone_coder perfect, thanks
 
ctrl +k twice :|
i thought it must be called once. sorry
 
It's sometimes weird... Some users need to highlight the text before ctrl+K. It depends on the browser too, probably. That's why you have to figure out in the sandbox how to make it work.
@lone_coder for me once is enough
 
can i copy the entire 86 lines tho?
 
10:50 PM
No, that's too much for chat. Better left in a code paste site.
 
okay
 
You could, but you need to host that off-site and link back here
And actually self.engine.execute('SELECT 1').fetchall() is suspect if you don't show the setup. I've honestly not worked with Qt but it looks like you have an underpinning of SQLAlchemy?
I don't know whether there are other wrappers involved :/
 
there's not much i could find regarding these two module (Qt and sqlalchemy/mysql) working together
btw. my code actually works fine. but the terminal gave me that error in the close event QThread: Destroyed while thread is still running. I'm just worried and curious if i could sort it out
 
Mmm, well I need sleep soon. I'm almost certain that you're using SQLA (maybe around a a MySQL connection)
 
i'm on the other side of earth lol. its okay. its 6 am here
 
11:02 PM
In which case, you should be using a scoped_session to kill stuff if you're opening sessions in threads
 
i'm looking into that. thanks for advice!
 
:)
I think that's what you'll need but, like I said, I don't know the GUI libraries. Rbrb
 
@AndrasDeak what's up :)
 
11:28 PM
@idjaw my broadband just went away :'(
Otherwise all good, thanks :) And you?
 
06:00 - 21:0022:00 - 00:00

« first day (3670 days earlier)      last day (1282 days later) »