Python – No handlers could be found for logger “OpenGL.error”

Looks like OpenGL is trying to report some error on Win2003, however you’ve not configured your system where to output logging info. You can add the following to the beginning of your program and you’ll see details of the error in stderr. import logging logging.basicConfig() Checkout documentation on logging module to get more config info, … Read more

How to stop a looping thread in Python?

Threaded stoppable function Instead of subclassing threading.Thread, one can modify the function to allow stopping by a flag. We need an object, accessible to running function, to which we set the flag to stop running. We can use threading.currentThread() object. import threading import time def doit(arg): t = threading.currentThread() while getattr(t, “do_run”, True): print (“working … Read more

How can I create a simple message box in Python?

You could use an import and single line code like this: import ctypes # An included library with Python install. ctypes.windll.user32.MessageBoxW(0, “Your text”, “Your title”, 1) Or define a function (Mbox) like so: import ctypes # An included library with Python install. def Mbox(title, text, style): return ctypes.windll.user32.MessageBoxW(0, text, title, style) Mbox(‘Your title’, ‘Your text’, … Read more

Programmatically generate video or animated GIF in Python?

I’d recommend not using images2gif from visvis because it has problems with PIL/Pillow and is not actively maintained (I should know, because I am the author). Instead, please use imageio, which was developed to solve this problem and more, and is intended to stay. Quick and dirty solution: import imageio images = [] for filename … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)