pop-up with python progress bar

Asked

Viewed 91 times

2

I am currently migrating a system to python and it has a window that opens making the progress bar. In my migration I used the tqdm to generate a progress bar on the system, but in another part of the code I used ctypes as in the example below:

verify = ctypes.windll.user32.MessageBoxW(0, text, title, 4)

I wonder if I can also use ctypes to call the Windows progress bar (or something similar) in python, since I already use it for other purposes.

1 answer

2


Power can. I don’t have a windows here to put some examples - but most likely you can call these functions already ready for use in Python in pywin32 - https://github.com/mhammond/pywin32 - will be much better than calling using ctypes because when calling a function in native code from Python using ctypes, you have to worry about problems of type conversion, memory allocation, and errors in that part can make the interpreter stop suddenly, without an error with stack trace, which describes exactly what went wrong.

So if there is a ready-made library that already accesses the same functions, it is always preferable to use it, since it will do all this part - and then your code only has to deal with things in pure Python, and it is much simpler.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.