pywin32

How to Watch Excel File Change While openpyxl Makes Changes

大憨熊 提交于 2019-12-23 05:09:36
问题 I built an iOS app that takes users' inputs then uploads their data as .csv files onto dropbox. Now, I'd like to build a cross-platform desktop app that uses openpyxl and the Python dropbox api to listen for these .csv uploads and then write the data in these .csv files to various .xlsx workbooks. I have no issues with this, except my client wants to be able to watch on their desktop as the excel workbooks change. Whenever I make an assignment with openpyxl, such as... wb = load_workbook(

Python - pywin32 getting bitmap of client area?

冷暖自知 提交于 2019-12-23 04:22:42
问题 I'm trying to use the pywin32 module to get the bitmap of a window's client area. Using the exact code from this question I am able to get the bitmap of the entire desktop. Specifically, when I look at the bits returned, there are 4*(desktop-pixels) number of entries. However, when I try to do something similar for a window or client area, I get less entries returned then there are pixels. My code for getting the window bitmap is below. However, I have tried several variations on it. For

Python - pywin32 getting bitmap of client area?

拜拜、爱过 提交于 2019-12-23 04:22:41
问题 I'm trying to use the pywin32 module to get the bitmap of a window's client area. Using the exact code from this question I am able to get the bitmap of the entire desktop. Specifically, when I look at the bits returned, there are 4*(desktop-pixels) number of entries. However, when I try to do something similar for a window or client area, I get less entries returned then there are pixels. My code for getting the window bitmap is below. However, I have tried several variations on it. For

which argtypes for NetShareAdd

老子叫甜甜 提交于 2019-12-23 04:10:19
问题 The win32 function NetShareDel takes three arguments, LPCWSTR LPCWSTR and DWORD. So I use the following list for argtypes: C.windll.Netapi32.NetShareDel.argtypes = [LPCWSTR, LPCWSTR, c_int] C.windll.Netapi32.NetShareDel.restype = c_int C.windll.Netapi32.NetShareDel(server, shareName, 0) That works fine, but I can't figure out what to use for NetShareAdd, especialle the byte array for NET_SHARE_INFO struct and the last byref(c_int) argument. Here's the code: def Share(server, shareName, dir):

which argtypes for NetShareAdd

让人想犯罪 __ 提交于 2019-12-23 04:09:09
问题 The win32 function NetShareDel takes three arguments, LPCWSTR LPCWSTR and DWORD. So I use the following list for argtypes: C.windll.Netapi32.NetShareDel.argtypes = [LPCWSTR, LPCWSTR, c_int] C.windll.Netapi32.NetShareDel.restype = c_int C.windll.Netapi32.NetShareDel(server, shareName, 0) That works fine, but I can't figure out what to use for NetShareAdd, especialle the byte array for NET_SHARE_INFO struct and the last byref(c_int) argument. Here's the code: def Share(server, shareName, dir):

How to set value in text box using pywinauto?

不想你离开。 提交于 2019-12-23 01:05:13
问题 I am new to pywinauto and I don't know how to use control identifiers. How would I set No. of loops: to 99999? 回答1: For dynamic edit box you can use label text as a part of identifier. Examples: app.WindowName.No__of_loops_Edit.set_text('99999') # or app.WindowName['No. of loops:Edit'].set_text('99999') # for more realistic typing char by char: app.WindowName['No. of loops:Edit'].type_keys('99999') It's described in more details in the Getting Started Guide (section "How to know magic

Creating new value inside registry Run key with Python?

眉间皱痕 提交于 2019-12-22 18:32:28
问题 I am trying to create a new value under the Run key in Windows 7. I am using Python 3.5 and I am having trouble writing to the key. My current code is creating a new key under the key I am trying to modify the values of. from winreg import * aKey = OpenKey(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run", 0, KEY_ALL_ACCESS) SetValue(aKey, 'NameOfNewValue', REG_SZ, '%windir%\system32\calc.exe') When I run this, it makes a key under the Run and names it "NameOfNewKey" and then

How can I get a list of removable drives plugged in the computer?

回眸只為那壹抹淺笑 提交于 2019-12-22 10:24:42
问题 I would like to get a list of the removable drivers that are plugged in to the computer. I think it can be done by using some registry, but I don't know how exactly. If there is another way I would like to hear about it. Note: It's important that I will be able to separate the removable drives from the fixed drives. 回答1: The algorithm is straightforward: Call [MS.Docs]: GetGetLogicalDriveStringsW function, which will return a string containing all the existing rootdirs (e.g. C:\\ ) separated

How can I get a list of removable drives plugged in the computer?

独自空忆成欢 提交于 2019-12-22 10:18:20
问题 I would like to get a list of the removable drivers that are plugged in to the computer. I think it can be done by using some registry, but I don't know how exactly. If there is another way I would like to hear about it. Note: It's important that I will be able to separate the removable drives from the fixed drives. 回答1: The algorithm is straightforward: Call [MS.Docs]: GetGetLogicalDriveStringsW function, which will return a string containing all the existing rootdirs (e.g. C:\\ ) separated

EnumChildWindows not working in pywin32

a 夏天 提交于 2019-12-22 08:05:25
问题 I want to get the children of a particular IE instance to see if there are any popups. I've made an .html page that pops up a window. The title of the popup is "Message from webpage", as it always is for this version of IE. I can get the parent from the child window: >>> child_handle = 15208472 >>> win32gui.GetWindowText(child_handle) 'Message from webpage' >>> win32gui.GetParent(child_handle) 33230502 >>> parent_handle = 33230502 >>> win32gui.GetWindowText(parent_handle) 'pop-up example -