[python-win32] Obsolete code paths and version-specific checks
Hi! While working on adding annotations for typing support in pure python modules, I noticed a lot of conditions and code made to run on older versions of Python. Which are both EOL and no longer supported in pywin32. Removing those would alleviate a lot of code and help smooth out the addition and validation of Python 3.7+ annotations. I would like to do a PR to tackle this, but first, is there anything specific I should be weary of? ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Pywin32 without the interface
On 12/2/22 12:10 PM, Tim Roberts wrote: On 12/2/22 4:25 AM, QMUL_EECS DVS wrote: Is it related to the fact that I can’t open Visio/ Word windows? If so, is there a way for me to avoid this error? The first and most obvious question is, do you actually have Office and Visio installed on your AWS instance? How did you do that without a UI? Launching Word like this usually does not bring up a UI window unless you specifically set "xxx.Visible = True", so I'm guessing there's something else going on. My apologies for the multiple replies. Either my connection or my mail server had a "burp", and it told me it had not sent anything when it clearly had. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Pywin32 without the interface
On 12/2/22 4:25 AM, QMUL_EECS DVS wrote: Thanks for replying. Apologies for my vague question, let me see if I can rephrase: I want to run pywin inside an aws instance, which only allows for command line interface. Currently I can use pywin in my local machine, but it needs to open Visio and Word windows. However, in the aws instance it throws an error: ‘ Traceback (most recent call last): File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 86, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None) ... File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch, None, clsctx, pythoncom.IID_IDispatch pywintypes.com_error: (-2147024891, 'Access is denied.', None, None)’ Is it related to the fact that I can’t open Visio/ Word windows? If so, is there a way for me to avoid this error? The first and most obvious question is, do you actually have Office and Visio installed on your AWS instance? How did you do that without a UI? Launching Word like this usually does not bring up a UI window unless you specifically set "xxx.Visible = True", so I'm guessing there's something else going on. -- Tim Roberts,t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Pywin32 without the interface
On 12/2/22 4:25 AM, QMUL_EECS DVS wrote: Thanks for replying. Apologies for my vague question, let me see if I can rephrase: I want to run pywin inside an aws instance, which only allows for command line interface. Currently I can use pywin in my local machine, but it needs to open Visio and Word windows. However, in the aws instance it throws an error: ‘ Traceback (most recent call last): File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 86, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None) ... File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch, None, clsctx, pythoncom.IID_IDispatch pywintypes.com_error: (-2147024891, 'Access is denied.', None, None)’ Is it related to the fact that I can’t open Visio/ Word windows? If so, is there a way for me to avoid this error? The first and most obvious question is, do you actually have Office and Visio installed on your AWS instance? How did you do that without a UI? Launching Word like this usually does not bring up a UI window unless you specifically set "xxx.Visible = True", so I'm guessing there's something else going on. -- Tim Roberts,t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Pywin32 without the interface
On 12/2/22 4:25 AM, QMUL_EECS DVS wrote: Thanks for replying. Apologies for my vague question, let me see if I can rephrase: I want to run pywin inside an aws instance, which only allows for command line interface. Currently I can use pywin in my local machine, but it needs to open Visio and Word windows. However, in the aws instance it throws an error: ‘ Traceback (most recent call last): File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 86, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None) ... File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch, None, clsctx, pythoncom.IID_IDispatch pywintypes.com_error: (-2147024891, 'Access is denied.', None, None)’ Is it related to the fact that I can’t open Visio/ Word windows? If so, is there a way for me to avoid this error? The first and most obvious question is, do you actually have Office and Visio installed on your AWS instance? How did you do that without a UI? Launching Word like this usually does not bring up a UI window unless you specifically set "xxx.Visible = True", so I'm guessing there's something else going on. -- Tim Roberts,t...@probo.com Providenza & Boekelheide, Inc. ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Pywin32 without the interface
Hi Tim, Thanks for replying. Apologies for my vague question, let me see if I can rephrase: I want to run pywin inside an aws instance, which only allows for command line interface. Currently I can use pywin in my local machine, but it needs to open Visio and Word windows. However, in the aws instance it throws an error: ‘ Traceback (most recent call last): File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 86, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\vmb-cdp-sld\cdp_sld_main.py", line 1046, in main() File "C:\vmb-cdp-sld\cdp_sld_main.py", line 387, in main sld_file_name = build_sld_diagram(path, opp_id, version_no, route_full) File "C:\vmb-cdp-sld\cdp_sld_main.py", line 625, in build_sld_diagram appVisio = win32com.client.gencache.EnsureDispatch('Visio.Application') File "C:\Program Files\Python37\lib\site-packages\win32com\client\gencache.py", line 618, in EnsureDispatch disp = win32com.client.Dispatch(prog_id) File "C:\Program Files\Python37\lib\site-packages\win32com\client\__init__.py", line 117, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch, userName, clsctx) File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 106, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Program Files\Python37\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch, None, clsctx, pythoncom.IID_IDispatch pywintypes.com_error: (-2147024891, 'Access is denied.', None, None)’ Is it related to the fact that I can’t open Visio/ Word windows? If so, is there a way for me to avoid this error? Thanks Nina On Thu, 1 Dec 2022 at 05:07 Tim Roberts wrote: > On 11/30/22 8:16 AM, QMUL_EECS DVS wrote: > > > I hope you are well. I’m trying to use pywin32 on my local server, is > > it possible to run it without the Visio/ Word interface open? Since I > > can only see the command line > > The question doesn't make much sense. Are you saying that you want to > automate Visio and Word through pythoncom, but you don't want the > application window to be visible? That can be done. Please clarify. > > -- > Tim Roberts, t...@probo.com > Providenza & Boekelheide, Inc. > > ___ > python-win32 mailing list > python-win32@python.org > https://mail.python.org/mailman/listinfo/python-win32 > ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32