From nina.punji at gmail.com Fri Dec 2 07:25:54 2022 From: nina.punji at gmail.com (QMUL_EECS DVS) Date: Fri, 2 Dec 2022 12:25:54 +0000 Subject: [python-win32] Pywin32 without the interface In-Reply-To: <51adf103-005e-527c-1c8a-1b4585da808a@probo.com> References: <51adf103-005e-527c-1c8a-1b4585da808a@probo.com> Message-ID: 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, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Dec 2 15:09:28 2022 From: timr at probo.com (Tim Roberts) Date: Fri, 2 Dec 2022 12:09:28 -0800 Subject: [python-win32] Pywin32 without the interface In-Reply-To: References: <51adf103-005e-527c-1c8a-1b4585da808a@probo.com> Message-ID: <4e95e88b-f3ec-4821-9d90-d895a6ab5a1f@probo.com> 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,timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Dec 2 15:09:34 2022 From: timr at probo.com (Tim Roberts) Date: Fri, 2 Dec 2022 12:09:34 -0800 Subject: [python-win32] Pywin32 without the interface In-Reply-To: References: <51adf103-005e-527c-1c8a-1b4585da808a@probo.com> Message-ID: 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,timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Dec 2 15:10:21 2022 From: timr at probo.com (Tim Roberts) Date: Fri, 2 Dec 2022 12:10:21 -0800 Subject: [python-win32] Pywin32 without the interface In-Reply-To: References: <51adf103-005e-527c-1c8a-1b4585da808a@probo.com> Message-ID: <0ac53fc7-a37b-cf9c-6285-0f79f8b1c97f@probo.com> 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,timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Dec 2 15:22:05 2022 From: timr at probo.com (Tim Roberts) Date: Fri, 2 Dec 2022 12:22:05 -0800 Subject: [python-win32] Pywin32 without the interface In-Reply-To: <0ac53fc7-a37b-cf9c-6285-0f79f8b1c97f@probo.com> References: <51adf103-005e-527c-1c8a-1b4585da808a@probo.com> <0ac53fc7-a37b-cf9c-6285-0f79f8b1c97f@probo.com> Message-ID: <9d8d62d8-5d22-3121-b2d2-476914b61afc@probo.com> 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, timr at probo.com Providenza & Boekelheide, Inc. From samuel.06 at hotmail.com Fri Dec 2 19:50:38 2022 From: samuel.06 at hotmail.com (Samuel Therrien) Date: Sat, 3 Dec 2022 00:50:38 +0000 Subject: [python-win32] Obsolete code paths and version-specific checks Message-ID: 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? -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Sun Dec 4 02:50:54 2022 From: skippy.hammond at gmail.com (Mark Hammond) Date: Sun, 4 Dec 2022 18:50:54 +1100 Subject: [python-win32] Obsolete code paths and version-specific checks In-Reply-To: References: Message-ID: On 3/12/2022 11:50 am, Samuel Therrien wrote: > 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? Hi Samuel, I'm perfectly fine with removing unsupported code - a PR just doing that before any others would be perfect! I'd also love to know more about the annotations, but having that convo on github seems fine. Cheers, Mark From nina.punji at gmail.com Mon Dec 5 08:25:06 2022 From: nina.punji at gmail.com (QMUL_EECS DVS) Date: Mon, 5 Dec 2022 13:25:06 +0000 Subject: [python-win32] Pywin32 without the interface In-Reply-To: <9d8d62d8-5d22-3121-b2d2-476914b61afc@probo.com> References: <51adf103-005e-527c-1c8a-1b4585da808a@probo.com> <0ac53fc7-a37b-cf9c-6285-0f79f8b1c97f@probo.com> <9d8d62d8-5d22-3121-b2d2-476914b61afc@probo.com> Message-ID: Hi Tim, Thanks for your reply. We do have Visio and Word installed on the instance, because it allows us to use a windows interface. However, we are trying to create an Airflow job that calls the python script that uses pywin32, hence we can?t use the ui. But at the moment, when we use pywin32 using the ui it always opens Visio and Word , even though we don?t specifically set "xxx.Visible = True" as you mentioned. Thanks, On Fri, 2 Dec 2022 at 20:22 Tim Roberts wrote: > 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, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at brian3johnson.me Mon Dec 5 20:56:04 2022 From: brian at brian3johnson.me (Brian Johnson) Date: Tue, 06 Dec 2022 01:56:04 -0000 Subject: [python-win32] pywin32 Documentation Message-ID: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> Hi.I took a stab at upgrading and "untangling" the documentation. I am willing to work on this documentation "untangling" project. Before I put more effort into it, I would like to get feedback from Mark and other contributors on what I'm proposing. If so, I'll log an Issue and/or pull request.Motivation: I need to work with a COM server application and want to use python. I found it challenging to find documentation and examples. Also, Mark mentioned this in the repo README: "Lots of that is very old, but some is auto-generated and current. Would love help untangling the docs!"Where: The current iteration is hosted on my forked repo at?Python for Windows Extensions ? pywin32 305 documentation (brian3johnson.github.io). If this effort moves forward, I'll pull it down once it's built and posted from mhammond's repo.How: I am building the documentation with sphinx?Welcome ? Sphinx documentation (sphinx-doc.org)?to update the narrative docs and automate or semi-automate the pywin32 API reference. I am using the default theme. I'm using reStructuredText (.rst) for the docs.What: I included all the existing narrative documentation from the CHM. Most of it remains unformatted, except for a couple of docs. I added a Home page, Installation, Support, and Resources pages, and the start of a Getting Started Tutorial.Proposed Next Steps:1. Confirm if I move forward with sphinx. If so, confirm if we use reStructuredText (reStructuredText ? Sphinx documentation (sphinx-doc.org)) or Markdown (Markdown ? Sphinx documentation (sphinx-doc.org))?for narrative documents.2. Finish formatting the existing narrative docs per rst or md.3. Add docstrings to .py source files to generate API docs.4. Convert some of the "samples" embedded in the source files to "How-tos".I have more ideas and suggestions, which I can share in an Issue, PR, or on this mailing list.I look forward to hearing what you think.Sincerely,Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Mon Dec 5 21:26:55 2022 From: mhammond at skippinet.com.au (Mark Hammond) Date: Tue, 6 Dec 2022 13:26:55 +1100 Subject: [python-win32] pywin32 Documentation In-Reply-To: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> References: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> Message-ID: <0c59c9ba-5062-8448-5bc8-649be9c9fdb5@skippinet.com.au> Hi Brian, Thanks for your interest. I probably should have written more about this earlier. From my POV, the main considerations I have are: 1) Much of the documentation is inside the c++ source formatted via "autoduck" style comments. I really don't want to abandon this documentation, but I don't think it's helpful in a sphinx-based world? 2) There's no where near as much docs embedded in the .py code, which is something that we can address. However, some work has started on https://github.com/mhammond/pywin32/issues/1913, which hopes to add type annotations - see also yesterday's mail to this list on this topic. While I'm not quite sure exactly what approach is being suggested for that, it seems possible it will have at least *some* overlap here? 3) Working out a good layout in the repo for docs is also important, but I don't forsee any real obstacles here - as you mention, a TOC etc are important. .rst seems like a perfectly reasonable format for hand-written docs, and given there aren't really that many hand-written docs in the tree which remain relevant, hand-converting them to largely unformatted markdown seems reasonable in the first instance. There's always going to be a bit of tension between keeping the docs organized and trying to keep the docs fairly close to the implementation they are documenting, but we can manage that. 4) I'd want to kill the existing tooling entirely as it's just going stale. Eg, the way https://mhammond.github.io/pywin32/ is built is interesting (it decompiles the .chm!) but that seems like a dead-end - I suspect that at some point it will end up extremely difficult to build that .chm in the first place - finding the Windows HTML Help compiler today is difficult enough. So really, the big unknowns for me that need answering are: * How exactly do the autoduck comments get handled as they change? * How does adding docs to the .py files overlap with adding type hints? * Does it replace the existing system rather than adding yet more complexity to it? I'll look a little more at your repo over the next week or so, but I'm currently a bit short on time, but really am interested in improving the docs, so thanks! Mark On 6/12/2022 12:56 pm, Brian Johnson wrote: > Hi. > > I took a stab at upgrading and "untangling" the documentation. I am > willing to work on this documentation "untangling" project. Before I put > more effort into it, I would like to get feedback from Mark and other > contributors on what I'm proposing. If so, I'll log an Issue and/or pull > request. > > *Motivation*: I need to work with a COM server application and want to > use python. I found it challenging to find documentation and examples. > Also, Mark mentioned this in the repo README: /"Lots of that is very > old, but some is auto-generated and current. Would love help untangling > the docs!"/ > > *Where*: The current iteration is hosted on my forked repo at Python for > Windows Extensions ? pywin32 305 documentation (brian3johnson.github.io) > . If this effort > moves forward, I'll pull it down once it's built and posted from > mhammond's repo. > > *How*: I am building the documentation with sphinx Welcome ? Sphinx > documentation (sphinx-doc.org) > ?to update the narrative docs and > automate or semi-automate the pywin32 API reference. I am using the > default theme. I'm using reStructuredText (.rst) for the docs. > > *What*: I included all the existing narrative documentation from the > CHM. Most of it remains unformatted, except for a couple of docs. I > added a Home page, Installation, Support, and Resources pages, and the > start of a Getting Started Tutorial. > > *Proposed Next Steps*: > > 1. Confirm if I move forward with sphinx. If so, confirm if we use > reStructuredText (reStructuredText ? Sphinx documentation > (sphinx-doc.org) > ) or Markdown (Markdown ? Sphinx documentation (sphinx-doc.org) )?for narrative documents. > 2. Finish formatting the existing narrative docs per rst or md. > 3. Add docstrings to .py source files to generate API docs. > 4. Convert some of the "samples" embedded in the source files to "How-tos". > > I have more ideas and suggestions, which I can share in an Issue, PR, or > on this mailing list. > > I look forward to hearing what you think. > > Sincerely, > Brian > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 From brian at brian3johnson.me Mon Dec 5 22:51:34 2022 From: brian at brian3johnson.me (Brian Johnson) Date: Tue, 06 Dec 2022 03:51:34 -0000 Subject: [python-win32] pywin32 Documentation In-Reply-To: <0c59c9ba-5062-8448-5bc8-649be9c9fdb5@skippinet.com.au> References: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> <0c59c9ba-5062-8448-5bc8-649be9c9fdb5@skippinet.com.au> Message-ID: <9f09c619-6a0a-4786-9cc0-202c4f4fc5fb@me.com> Hi Mark.Thank you for the feedback. My responses in-line below. Also...Example of reformatted narrative doc:Quick Start to Client side COM and Python ? pywin32 305 documentation (brian3johnson.github.io)Example of api docs generated from .py docstring:adodbapi package ? pywin32 305 documentation (brian3johnson.github.io)Note: the TOC sidebar still needs work. Thanks for your interest. I probably should have written more about this earlier. From my POV, the main considerations I have are:1) Much of the documentation is inside the c++ source formatted via "autoduck" style comments. I really don't want to abandon this documentation, but I don't think it's helpful in a sphinx-based world?BJ > I would not want to abandon this either. I don't know much about Autoduck apart from gathering that it generates documentation from the C++ source. There may be an approach using SWIG with some modifications within the C++ source code:https://www.swig.org/Doc4.1/Python.html#Python_nn65?2) There's no where near as much docs embedded in the .py code, which is something that we can address. However, some work has started on https://github.com/mhammond/pywin32/issues/1913, which hopes to add type annotations - see also yesterday's mail to this list on this topic. While I'm not quite sure exactly what approach is being suggested for that, it seems possible it will have at least *some* overlap here?BJ > Yes, I saw the email about this yesterday. Good news is that those type hints/annotations can be used by sphinx to generate the api docs. In fact, this is something I would have done as part of this documentation effort.3) Working out a good layout in the repo for docs is also important, but I don't forsee any real obstacles here - as you mention, a TOC etc are important. .rst seems like a perfectly reasonable format for hand-written docs, and given there aren't really that many hand-written docs in the tree which remain relevant, hand-converting them to largely unformatted markdown seems reasonable in the first instance. There's always going to be a bit of tension between keeping the docs organized and trying to keep the docs fairly close to the implementation they are documenting, but we can manage that.BJ> Agreed.4) I'd want to kill the existing tooling entirely as it's just going stale. Eg, the way https://mhammond.github.io/pywin32/ is built is interesting (it decompiles the .chm!) but that seems like a dead-end - I suspect that at some point it will end up extremely difficult to build that .chm in the first place - finding the Windows HTML Help compiler today is difficult enough.BJ> I agree with this as well. In fact, sphinx can generate HTMLHelp for compiling to CHM if you still want to have a CHM file available.So really, the big unknowns for me that need answering are:* How exactly do the autoduck comments get handled as they change?BJ> Maybe via SWIG. More research needed.* How does adding docs to the .py files overlap with adding type hints?BJ> Overlaps perfectly.* Does it replace the existing system rather than adding yet more complexity to it?BJ> ReplacesI'll look a little more at your repo over the next week or so, but I'm currently a bit short on time, but really am interested in improving the docs, so thanks!BJ> Sounds good! Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Tue Dec 6 08:33:05 2022 From: vernondcole at gmail.com (Vernon D. Cole) Date: Tue, 6 Dec 2022 06:33:05 -0700 Subject: [python-win32] pywin32 Documentation In-Reply-To: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> References: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> Message-ID: The most important document for adodbapi is in Markdown. (That's an improvement - - I wrote it in .odt) so if that helps the decision, I would say lean toward that direction. It needs to be linked / indexed in where people can actually find it. adodbapi/quick_reference.md If we make an actual .docs directory, it should move there. It also needs an edit pass to get rid of obsolete references to Python 2 and to check that the external links still work and so forth. I'll add that to my to-do list. On Mon, Dec 5, 2022 at 6:57 PM Brian Johnson wrote: > Hi. > > I took a stab at upgrading and "untangling" the documentation. I am > willing to work on this documentation "untangling" project. Before I put > more effort into it, I would like to get feedback from Mark and other > contributors on what I'm proposing. If so, I'll log an Issue and/or pull > request. > > *Motivation*: I need to work with a COM server application and want to > use python. I found it challenging to find documentation and examples. > Also, Mark mentioned this in the repo README: *"Lots of that is very old, > but some is auto-generated and current. Would love help untangling the > docs!"* > > *Where*: The current iteration is hosted on my forked repo at Python for > Windows Extensions ? pywin32 305 documentation (brian3johnson.github.io) > . If this effort > moves forward, I'll pull it down once it's built and posted from mhammond's > repo. > > *How*: I am building the documentation with sphinx Welcome ? Sphinx > documentation (sphinx-doc.org) to > update the narrative docs and automate or semi-automate the pywin32 API > reference. I am using the default theme. I'm using reStructuredText (.rst) > for the docs. > > *What*: I included all the existing narrative documentation from the CHM. > Most of it remains unformatted, except for a couple of docs. I added a Home > page, Installation, Support, and Resources pages, and the start of a > Getting Started Tutorial. > > *Proposed Next Steps*: > > 1. Confirm if I move forward with sphinx. If so, confirm if we use > reStructuredText (reStructuredText ? Sphinx documentation (sphinx-doc.org) > ) > or Markdown (Markdown ? Sphinx documentation (sphinx-doc.org) > ) for narrative > documents. > 2. Finish formatting the existing narrative docs per rst or md. > 3. Add docstrings to .py source files to generate API docs. > 4. Convert some of the "samples" embedded in the source files to "How-tos". > > I have more ideas and suggestions, which I can share in an Issue, PR, or > on this mailing list. > > I look forward to hearing what you think. > > Sincerely, > Brian > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Tue Dec 6 08:51:56 2022 From: vernondcole at gmail.com (Vernon D. Cole) Date: Tue, 6 Dec 2022 06:51:56 -0700 Subject: [python-win32] pywin32 Documentation In-Reply-To: <9f09c619-6a0a-4786-9cc0-202c4f4fc5fb@me.com> References: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> <0c59c9ba-5062-8448-5bc8-649be9c9fdb5@skippinet.com.au> <9f09c619-6a0a-4786-9cc0-202c4f4fc5fb@me.com> Message-ID: Brian: I did not see your entry before writing mine. Fantastic work on the adodbapi calling interfaces! I think that there is still a need for something like the quick_reference, so that there can be discussion about things like the extensions. The ability to switch between paramstyles is probably still unique. There was discussion in the dbapi community that it was impossible to do. Sometimes that sort of thing is best presented in paragraph format. I still have the original source for *Python Programming on Win32* (thank you, Mark) but O'Reilly was not interested in publishing a second edition several years ago. Perhaps it is time to ask them again. On Tue, Dec 6, 2022 at 3:02 AM Brian Johnson wrote: > Hi Mark. > > Thank you for the feedback. My responses in-line below. Also... > > *Example of reformatted narrative doc*: > Quick Start to Client side COM and Python ? pywin32 305 documentation > (brian3johnson.github.io) > > *Example of api docs generated from .py docstring*: > adodbapi package ? pywin32 305 documentation (brian3johnson.github.io) > > *Note: the TOC sidebar still needs work.* > > Thanks for your interest. I probably should have written more about > this earlier. From my POV, the main considerations I have are: > > 1) Much of the documentation is inside the c++ source formatted via > "autoduck" style comments. I really don't want to abandon this > documentation, but I don't think it's helpful in a sphinx-based world? > > > BJ > I would not want to abandon this either. I don't know much about > Autoduck apart from gathering that it generates documentation from the C++ > source. There may be an approach using SWIG with some modifications within > the C++ source code: > https://www.swig.org/Doc4.1/Python.html#Python_nn65 > > 2) There's no where near as much docs embedded in the .py code, which is > something that we can address. However, some work has started on > https://github.com/mhammond/pywin32/issues/1913, which hopes to add type > annotations - see also yesterday's mail to this list on this topic. > While I'm not quite sure exactly what approach is being suggested for > that, it seems possible it will have at least *some* overlap here? > > > BJ > Yes, I saw the email about this yesterday. Good news is that those > type hints/annotations can be used by sphinx to generate the api docs. In > fact, this is something I would have done as part of this documentation > effort. > > 3) Working out a good layout in the repo for docs is also important, but > I don't forsee any real obstacles here - as you mention, a TOC etc are > important. .rst seems like a perfectly reasonable format for > hand-written docs, and given there aren't really that many hand-written > docs in the tree which remain relevant, hand-converting them to largely > unformatted markdown seems reasonable in the first instance. There's > always going to be a bit of tension between keeping the docs organized > and trying to keep the docs fairly close to the implementation they are > documenting, but we can manage that. > > > BJ> Agreed. > > 4) I'd want to kill the existing tooling entirely as it's just going > stale. Eg, the way https://mhammond.github.io/pywin32/ is built is > interesting (it decompiles the .chm!) but that seems like a dead-end - I > suspect that at some point it will end up extremely difficult to build > that .chm in the first place - finding the Windows HTML Help compiler > today is difficult enough. > > > BJ> I agree with this as well. In fact, sphinx can generate HTMLHelp for > compiling to CHM if you still want to have a CHM file available. > > So really, the big unknowns for me that need answering are: > > * How exactly do the autoduck comments get handled as they change? > > > BJ> Maybe via SWIG. More research needed. > > * How does adding docs to the .py files overlap with adding type hints? > > > BJ> Overlaps perfectly. > > * Does it replace the existing system rather than adding yet more > complexity to it? > > > BJ> Replaces > > I'll look a little more at your repo over the next week or so, but I'm > currently a bit short on time, but really am interested in improving the > docs, so thanks! > > > BJ> Sounds good! Thanks! > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at brian3johnson.me Tue Dec 6 08:43:27 2022 From: brian at brian3johnson.me (Brian Johnson) Date: Tue, 6 Dec 2022 07:43:27 -0600 Subject: [python-win32] pywin32 Documentation In-Reply-To: References: Message-ID: An HTML attachment was scrubbed... URL: From jacob at blindza.co.za Tue Dec 6 08:34:04 2022 From: jacob at blindza.co.za (jacob kruger) Date: Tue, 6 Dec 2022 15:34:04 +0200 Subject: [python-win32] imap mail parsing - forms of socket timeout/EOF errors Message-ID: Hi there Know haven't posted on this list for a little while now, but, thought may as well ask if any of you guys have an idea about what seems to be a pretty common issue, but, with no specific, or consistent workarounds that am finding mention of via various google searches, etc. Effectively, if trying to use either the imaplib, or the poplib modules to query a remote mail server inbox, to then parse the mail messages contents, to insert them into a postgresql database, for more efficient querying/referencing, I am, at times - not consistently at all - receiving one of the two following messages, depending on which protocol/client I was trying to make use of:- the error message/exception information am getting from imap is the following: imaplib.IMAP4.abort: command: FETCH => socket error: EOF the pop3 error message is the following: poplib.error_proto: -ERR EOF For example, if just run same code against my one test server, with just 100 messages in the inbox, it works fine every time on both protocols, but, when try run it against the live mailbox, which has over 2 million mails in it, this happens on a regular, if inconsistent basis when you try retrieving specific messages each time, based on their server-side UID/ID. So, just wondering if anyone has come across things like this before, has ideas about implementing a form of timeout, or connection renewal, or if you have ideas about additional resources could try making use of instead for this type of thing - main thing is want to be able to, initially at least, just parse all the mail contents, updating the database on a repeated basis, since this inbox receives a lot of e-mails every hour/day, and, possibly, later on, be able to retrieve or interact with mail messages as well? Thanks in advance -- Jacob Kruger +2782 413 4791 Skype: BlindZA "...resistance is futile...but, acceptance is versatile..." -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at brian3johnson.me Tue Dec 6 09:26:20 2022 From: brian at brian3johnson.me (Brian Johnson) Date: Tue, 06 Dec 2022 14:26:20 -0000 Subject: [python-win32] pywin32 Documentation In-Reply-To: References: <591f0513-8a33-4034-9bed-b8f895a6a0aa@me.com> <0c59c9ba-5062-8448-5bc8-649be9c9fdb5@skippinet.com.au> <9f09c619-6a0a-4786-9cc0-202c4f4fc5fb@me.com> Message-ID: Vernon.The fantastic work is all yours. I simply started converting your quick_reference.md to reStructuredText.-BrianOn Dec 6, 2022, at 7:52 AM, Vernon D. Cole wrote:Brian:I did not see your entry before writing mine.??Fantastic work on the adodbapi calling interfaces!?I think that there is still a need for something like the quick_reference, so that there can be discussion about things like the extensions. The ability to switch between paramstyles is probably still unique. There was discussion in the dbapi community that it was impossible to do. Sometimes that sort of thing is best presented in paragraph format.I still have the original source for Python Programming on Win32?(thank you, Mark) but O'Reilly was not interested in publishing a second edition several?years ago. Perhaps it is time to ask them again.On Tue, Dec 6, 2022 at 3:02 AM Brian Johnson wrote:Hi Mark.Thank you for the feedback. My responses in-line below. Also...Example of reformatted narrative doc:Quick Start to Client side COM and Python ? pywin32 305 documentation (brian3johnson.github.io)Example of api docs generated from .py docstring:adodbapi package ? pywin32 305 documentation (brian3johnson.github.io)Note: the TOC sidebar still needs work.Thanks for your interest. I probably should have written more about this earlier. From my POV, the main considerations I have are:1) Much of the documentation is inside the c++ source formatted via "autoduck" style comments. I really don't want to abandon this documentation, but I don't think it's helpful in a sphinx-based world?BJ > I would not want to abandon this either. I don't know much about Autoduck apart from gathering that it generates documentation from the C++ source. There may be an approach using SWIG with some modifications within the C++ source code:https://www.swig.org/Doc4.1/Python.html#Python_nn65?2) There's no where near as much docs embedded in the .py code, which is something that we can address. However, some work has started on https://github.com/mhammond/pywin32/issues/1913, which hopes to add type annotations - see also yesterday's mail to this list on this topic. While I'm not quite sure exactly what approach is being suggested for that, it seems possible it will have at least *some* overlap here?BJ > Yes, I saw the email about this yesterday. Good news is that those type hints/annotations can be used by sphinx to generate the api docs. In fact, this is something I would have done as part of this documentation effort.3) Working out a good layout in the repo for docs is also important, but I don't forsee any real obstacles here - as you mention, a TOC etc are important. .rst seems like a perfectly reasonable format for hand-written docs, and given there aren't really that many hand-written docs in the tree which remain relevant, hand-converting them to largely unformatted markdown seems reasonable in the first instance. There's always going to be a bit of tension between keeping the docs organized and trying to keep the docs fairly close to the implementation they are documenting, but we can manage that.BJ> Agreed.4) I'd want to kill the existing tooling entirely as it's just going stale. Eg, the way https://mhammond.github.io/pywin32/ is built is interesting (it decompiles the .chm!) but that seems like a dead-end - I suspect that at some point it will end up extremely difficult to build that .chm in the first place - finding the Windows HTML Help compiler today is difficult enough.BJ> I agree with this as well. In fact, sphinx can generate HTMLHelp for compiling to CHM if you still want to have a CHM file available.So really, the big unknowns for me that need answering are:* How exactly do the autoduck comments get handled as they change?BJ> Maybe via SWIG. More research needed.* How does adding docs to the .py files overlap with adding type hints?BJ> Overlaps perfectly.* Does it replace the existing system rather than adding yet more complexity to it?BJ> ReplacesI'll look a little more at your repo over the next week or so, but I'm currently a bit short on time, but really am interested in improving the docs, so thanks!BJ> Sounds good! Thanks!_______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From savoy at liberation.red Tue Dec 6 13:08:42 2022 From: savoy at liberation.red (savoy) Date: Tue, 6 Dec 2022 12:08:42 -0600 Subject: [python-win32] Trouble finding MSOLAP provider with adodbapi Message-ID: <20221206180842.5ckirybiipqvltho@desktop> I'm trying to use python to connect to a Microsoft Analysis Services cube for MDX queries due to the phasing out of a SQL server that used to fill its place as the access point. I've downloaded the most up-to-date MSOLAP library from Microsoft's site (16.0.56.19) and installed it. The location of the library is then saved as C:\\Program Files (x86)\Microsoft Analysis Services\AS OLEDB\140\msolap.dll. Using the connection string I've told is the correct to use (and also verifying it by using it in Microsoft Excel) with adodbapi.connect(), I get an OperationalError exception in python. Below is the text which also includes the obfuscated connection string. (com_error(-2147352567, 'Exception occurred.', (0, 'ADODB.Connection', 'Provider cannot be found. It may not be properly installed.', 'C:\\WINDOWS\\HELP\\AD027.CHM', 1240655, -2146824582), None), 'Error opening connection to "Provider=MSOLAP.8;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=bi_mdp_SEMANTIC_live_db;Data Source=subdomain.domain.com;MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error;Update Isolation Level=2"'). Is there something that I'm missing in order for the connection to work? I take it that as I can get it working in Excel there isn't anything wrong with the installation, am I correct in that assumption? And if so, is there a piece I've left out? Thank you, savoy From timr at probo.com Tue Dec 6 18:11:26 2022 From: timr at probo.com (Tim Roberts) Date: Tue, 6 Dec 2022 15:11:26 -0800 Subject: [python-win32] Trouble finding MSOLAP provider with adodbapi In-Reply-To: <20221206180842.5ckirybiipqvltho@desktop> References: <20221206180842.5ckirybiipqvltho@desktop> Message-ID: savoy wrote: > > I've downloaded the most up-to-date MSOLAP library from Microsoft's site > (16.0.56.19) and installed it. The location of the library is then saved > as C:\\Program Files (x86)\Microsoft Analysis Services\AS > OLEDB\140\msolap.dll. That's a 32-bit DLL.? Your ODBC driver needs to match your Python bittedness, and most of us run 64-bit Python.? Is there a 64-bit version of the connector? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3428 bytes Desc: S/MIME Cryptographic Signature URL: From savoy at liberation.red Fri Dec 9 13:39:08 2022 From: savoy at liberation.red (savoy) Date: Fri, 9 Dec 2022 12:39:08 -0600 Subject: [python-win32] Trouble finding MSOLAP provider with adodbapi In-Reply-To: References: <20221206180842.5ckirybiipqvltho@desktop> Message-ID: <20221209183908.ps2rr4lflkgkshhb@desktop> >That's a 32-bit DLL.? Your ODBC driver needs to match your Python >bittedness, and most of us run 64-bit Python.? Is there a 64-bit >version of the connector? Well this is a lapse for me, I entirely misread the download link for the 64-bit version labeled as "amd64" as "arm64". I'm not very used to the way Microsoft organizes its documentation. The driver working in Excel is what threw me off, I was sure I was running the 64-bit Excel. I'm waiting on someone with admin rights to my machine to install the 64-bit version to verify, but that should hopefully clear it up. savoy From matteo.boscolo at boscolini.eu Thu Dec 15 13:22:44 2022 From: matteo.boscolo at boscolini.eu (Matteo Boscolo) Date: Thu, 15 Dec 2022 19:22:44 +0100 Subject: [python-win32] python 3.8 Alternative of py2exe for com server Message-ID: <111ae860-e11f-b362-a9de-53e56188f277@boscolini.eu> Dear list there is any alternative to build a com server and freeze it in python 3.8 regards, Matteo From antoine.ferron at bitlogik.fr Thu Dec 15 15:20:48 2022 From: antoine.ferron at bitlogik.fr (Antoine FERRON) Date: Thu, 15 Dec 2022 21:20:48 +0100 Subject: [python-win32] python 3.8 Alternative of py2exe for com server In-Reply-To: <111ae860-e11f-b362-a9de-53e56188f277@boscolini.eu> References: <111ae860-e11f-b362-a9de-53e56188f277@boscolini.eu> Message-ID: <7EFD5258-0FDD-4637-9971-E8ACF0ED6FEE@getmailspring.com> Hi Matteo, Yes, use pyinstaller. I let py2exe for 4 years I think, and pyinstaller is very helpful to build binary package for end users. I'm using to build binary packages for multiple projects, up to 3.9, no issue, and it gets better and better. I'm not using for your use case, but it should work. Regards, _____________________________________ Antoine FERRON Pr?sident ? BitLogiK bitlogik.fr (https://bitlogik.fr) ? PGP Key ID#22F95B31 (https://keys.openpgp.org/search?q=antoine.ferron%40bitlogik.fr) On Dec 15 2022, at 7:22 pm, Matteo Boscolo wrote: > Dear list there is any alternative to build a com server and freeze it > in python 3.8 > > regards, > Matteo > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bkline at rksystems.com Mon Dec 19 09:40:29 2022 From: bkline at rksystems.com (Bob Kline) Date: Mon, 19 Dec 2022 09:40:29 -0500 Subject: [python-win32] Windows scripting can't find _ctypes Message-ID: I just ran into a snag after upgrading to Python 3.11.1. Running Python 3.10.1 the ctypes module imports with no problems. Same under Windows scripting using the pywin32 package. With 3.11.1 importing ctypes directly still works. However, under Windows scripting using the pywin32 package "import ctypes" fails with the following error output: IActiveScriptError QI - unknown IID {B21FB2A1-5B8F-4963-8C21-21450F84ED7F} E:\tmp\test2.pys(12, 0) Python ActiveX Scripting Engine: Traceback (most recent call last): File "