Is there any way I can download an mp3 file using Python because as soon I get to this URL it automatically opens “file save dialog box” and I’m not able to download it using either the python requests module or PycURL programmatically? I’m getting this URL by using API. There is nothi…
Tag: winapi
Interrupt (NOT prevent from starting) screensaver
I am trying to programmatically interrupt the screensaver by moving the cursor like this: And it fails with the message: This error only occurs if the screensaver is actively running. The reason for this request is that the computer is ONLY used for inputting data through a bluetooth device (via a Python prog…
How to change username of job in print queue using python & win32print
I am trying to change the user of a print job in the queue, as I want to create it on a service account but send the job to another users follow-me printing queue. I’m using the win32 module in python. Here is an example of my code: The problem is I get an error at the win32print.SetJob() line. If
How to correctly decrypt data in python using RSA Private Key BLOB from windows
I have successfully constructed RSA2 key by splitting private key blob into n, e, d, p, q values with the following code: I did not get any error. However, when I’m trying to decrypt data with this key I get an error: incorrect decryption. I use this piece of code: At the same time I see that standart w…
how to select a particlular portion of a window’s client area to display in window’s thumbnail in the taskbar in Python/PyQt5/PySide2/Tkinter?
I want to set a particular portion(like only a frame or widget) of my application window to taskbar thumbnail.I found one windows API that is ITaskbarList3::SetThumbnailClip here but this is in C++.I want to do this in python.However PyQt5 contains one class that is Qt Windows Extras which doesnot include thi…
pywintypes.com_error: (-2147221008, ‘CoInitialize has not been called.’, None, None)
When I try to run this code as is I get this error “IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) pywintypes.com_error: (-2147221008, ‘CoInitialize has not been called.’, None, None)” , however if I run stp_tracker alone it works fine and if I…
python win32 COM closing excel workbook
I open several different workbooks (excel xlsx format) in COM, and mess with them. As the program progresses I wish to close one specific workbook but keep the rest open. How do I close ONE workbook? (instead of the entire excel application) Answer The the Workbook COM object has a Close() method. Basically, …