From sm5126 at columbia.edu Tue Apr 5 11:22:00 2022 From: sm5126 at columbia.edu (Sanaa Mouzahir) Date: Tue, 5 Apr 2022 11:22:00 -0400 Subject: [python-win32] (no subject) Message-ID: Hello. I hope you are doing well. I have some questions regarding the mapping from VBA to Python. This is regarding the COM object SOLIDWORKS. I am trying to translate the following VBA code: Set skSegment = Part.SketchManager.CreateSpline((pointArray)) Part.ClearSelection2 True Part.SketchManager.InsertSketch True Set swSkMan = Part.SketchManager Set swSketch = skSegment.GetSketch vSketchSeg = swSketch.GetSketchSegments On python. However,This part: *Part.SketchManager.CreateSpline((pointArray)) *gives the following error; Nonetype is not callable. -- *Sanaa Mouzahir* *Columbia University in the city of New York* *M.S Computational and data-driven engineering mechanics* *+19173614172* www.linkedin.com/in/sanaamouzahir -------------- next part -------------- An HTML attachment was scrubbed... URL: From jefferyliao at actgenomics.com Thu Apr 7 22:11:19 2022 From: jefferyliao at actgenomics.com (=?big5?B?SmVmZmVyeSBMaWFvICi5+avZpf4p?=) Date: Fri, 8 Apr 2022 02:11:19 +0000 Subject: [python-win32] file name contains brackets got converted to %5B and %5D Message-ID: <3dea4fe5a7a2489bb36ee2db1b6291b5@mail01.actgenomics.com> Hi, My docx file name contains brackets ([ and ]) and those brackets were changed to %5B and %5D after I convert the docx to pdf. e.g. before: name_[project_id]_date.docx after: name_%5Bproject_id%5D_date.pdf I've searched Document.ExportAsFixedFormat method (Word) and didn't find any option to change this behavior. Is there any way to keep the brackets in file name? Version of Python and pywin32: Python v3.8.10, pywin32 v300 Best regards Jeffery This message contains confidential information and is intended only for the individual(s) addressed in the message. If you aren't the named addressee, you should not disseminate, distribute, or copy this e-mail. If you aren't the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited. ACT Genomics Holdings Co. Ltd. and its subsidiaries -------------- next part -------------- An HTML attachment was scrubbed... URL: From christoph.dorner at gmx.de Sat Apr 9 05:52:11 2022 From: christoph.dorner at gmx.de (Christoph J. Dorner) Date: Sat, 9 Apr 2022 11:52:11 +0200 Subject: [python-win32] file name contains brackets got converted to %5B and %5D In-Reply-To: <3dea4fe5a7a2489bb36ee2db1b6291b5@mail01.actgenomics.com> References: <3dea4fe5a7a2489bb36ee2db1b6291b5@mail01.actgenomics.com> Message-ID: Hi, I am not sure If I gto the context, it is hard to understand what you have done witht he limited description. But I guess you passed a filename to a COM object ? Try to escape the brackets. And check for problems arising a) from the different notation conventions for pathnames and b) differences in unicode treatment in Python an COM. Regards Christoph Am 08.04.2022 um 04:11 schrieb Jeffery Liao (???): > > Hi, > > My docx file name contains brackets ([ and ]) and those brackets were > changed to %5B and %5D after I convert the docx to pdf. > > e.g. > > before: name_[project_id]_date.docx > > after: name_%5Bproject_id%5D_date.pdf > > I've searched Document.ExportAsFixedFormat > > method (Word) and didn't find any option to change this behavior. > > Is there any way to keep the brackets in file name? > > Version of Python and pywin32: > > Python v3.8.10, pywin32 v300 > > Best regards > Jeffery > > > This message contains confidential information and is intended only > for the individual(s) addressed in the message. If you aren't the > named addressee, you should not disseminate, distribute, or copy this > e-mail. If you aren't the intended recipient, you are notified that > disclosing, distributing, or copying this e-mail is strictly prohibited. > > ACT Genomics Holdings Co. Ltd. and its subsidiaries > > > > _______________________________________________ > 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 steven at manross.net Mon Apr 11 11:55:32 2022 From: steven at manross.net (Steven Manross) Date: Mon, 11 Apr 2022 15:55:32 +0000 Subject: [python-win32] file name contains brackets got converted to %5B and %5D In-Reply-To: References: <3dea4fe5a7a2489bb36ee2db1b6291b5@mail01.actgenomics.com> Message-ID: <7230fc7a0c754085bf5f260ab069a83b@manross.net> After thinking about this for a bit ? I thought that if the COM object is doing this and there?s no way to fix that behavior, you should be able to change the file name AFTER the COM object is done, via python like so. # this works on my W10 PC import os # make sure the file handle and or COM object is done locking the DOCX file first os.rename('c:\\somedir\\this%5Bproject_id%5D_date.docx', 'c:\\somedir\\this[project_id]_date.docx') Obviously, if the escaping works like Chris suggests, you wouldn?t need this. HTH Steven From: python-win32 On Behalf Of Christoph J. Dorner Sent: Saturday, April 09, 2022 2:52 AM To: jefferyliao at actgenomics.com; python-win32 at python.org Subject: Re: [python-win32] file name contains brackets got converted to %5B and %5D Hi, I am not sure If I gto the context, it is hard to understand what you have done witht he limited description. But I guess you passed a filename to a COM object ? Try to escape the brackets. And check for problems arising a) from the different notation conventions for pathnames and b) differences in unicode treatment in Python an COM. Regards Christoph Am 08.04.2022 um 04:11 schrieb Jeffery Liao (???): Hi, My docx file name contains brackets ([ and ]) and those brackets were changed to %5B and %5D after I convert the docx to pdf. e.g. before: name_[project_id]_date.docx after: name_%5Bproject_id%5D_date.pdf I've searched Document.ExportAsFixedFormat method (Word) and didn't find any option to change this behavior. Is there any way to keep the brackets in file name? Version of Python and pywin32: Python v3.8.10, pywin32 v300 Best regards Jeffery This message contains confidential information and is intended only for the individual(s) addressed in the message. If you aren't the named addressee, you should not disseminate, distribute, or copy this e-mail. If you aren't the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited. ACT Genomics Holdings Co. Ltd. and its subsidiaries _______________________________________________ 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 staff.phamj88 at uwosh.edu Fri Apr 15 14:33:16 2022 From: staff.phamj88 at uwosh.edu (John Pham) Date: Fri, 15 Apr 2022 18:33:16 +0000 Subject: [python-win32] pywin32-223 support request Message-ID: Good day, Just wondering if a silent uninstall is at all possible via powershell? I see in the registry that the uninstall string is ""C:\Python27\Removepywin32.exe" -u "C:\Python27\pywin32-wininst.log"" but is there a way to make the uninstall silent with no user interaction? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Mon Apr 18 20:43:09 2022 From: mhammond at skippinet.com.au (Mark Hammond) Date: Tue, 19 Apr 2022 10:43:09 +1000 Subject: [python-win32] pywin32-223 support request In-Reply-To: References: Message-ID: <22d47bd1-2b48-d663-d447-8492105f9ffc@skippinet.com.au> That uninstall capability is provided by distutils' support for .exe installers, and last I looked that did not offer unintended install or uninstall support - but things might have changed. Another option is to use pip to both install and uninstall. Cheers, Mark On 16/04/2022 4:33 am, John Pham wrote: > Good day, > > Just wondering if a silent uninstall is at all possible via powershell? > I see in the registry that the uninstall string is > ""C:\Python27\Removepywin32.exe" -u "C:\Python27\pywin32-wininst.log"" > > but is there a way to make the uninstall silent with no user interaction? > > Thanks! > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 From renderyourworld at gmail.com Mon Apr 25 15:00:43 2022 From: renderyourworld at gmail.com (Nicholas Pfeiffer) Date: Mon, 25 Apr 2022 15:00:43 -0400 Subject: [python-win32] Pythoncom PROPVARIANT Message-ID: Hi there, Where is the PROPVARIANT class located in the pythoncom library? The docs are not helpful about this: http://timgolden.me.uk/pywin32-docs/PyPROPVARIANT.html I've seen postings that use the propsys module but that one no longer contains the PROPVARIANT class unfortunately. I'm wondering if this class exists in a different package or if I can somehow recreate it? I need to write new properties to a file but using the WriteMultiple method will only let me write Strings with a prop variable id of 8 and I need them to show up as "Text" which has a prop variable id of 30. The only way I understand how to do this is to wrap the values used in the WriteMultiple method in a PROPVARIANT class call, but I haven't be able to figure out where that class is called from. Thanks for your help -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Mon Apr 25 22:56:19 2022 From: mhammond at skippinet.com.au (Mark Hammond) Date: Tue, 26 Apr 2022 12:56:19 +1000 Subject: [python-win32] Pythoncom PROPVARIANT In-Reply-To: References: Message-ID: On 26/04/2022 5:00 am, Nicholas Pfeiffer wrote: > Hi there, > > Where is the PROPVARIANT class located in the pythoncom library? > The docs are not helpful about this: > http://timgolden.me.uk/pywin32-docs/PyPROPVARIANT.html > > > I've seen postings that use the propsys module but that one no longer > contains the PROPVARIANT class unfortunately. It is implemented in that module - see https://github.com/mhammond/pywin32/blob/main/com/win32comext/propsys/src/PyPROPVARIANT.cpp. > I'm wondering if this class exists in a different package or if I can > somehow recreate it? > > I need to write new properties to a file but using the WriteMultiple > method will only let me write Strings with a prop variable id of 8 and I > need them to show up as "Text" which has a prop variable id of 30. 30 == VT_LPSTR which isn't supported by pywin32 - but VT_LPWSTR (31) is - you can create such an object with something like: >>> from win32com.propsys import propsys >>> import pythoncom >>> propsys.PROPVARIANTType("foo", pythoncom.VT_LPWSTR) > The only way I understand how to do this is to wrap the values used in > the WriteMultiple method in a PROPVARIANT class call, but I haven't be > able to figure out where that class is called from. Sorry, but I'm not familiar with using WriteMultiple and I suspect it will depends on what exactly is on the other end. HTH, Mark