From royalraja at gmail.com Mon Oct 5 11:24:10 2020 From: royalraja at gmail.com (Raja Sekhar) Date: Mon, 5 Oct 2020 20:54:10 +0530 Subject: [python-win32] AES based win32crypt lib for python3 Message-ID: Hi Team, I have seen win32crypt lib for python, And it is built on DES algorithm. I am searching for such library in Python using AES Algorithm. I have gone through pyAesCrypt, Crypto.Cipher which is taking an explicit key for encryption. I would be grateful if you could help me to find a library in python3, which uses AES encryption library similar to win32crypt which encrypts data using a session key derived from current user's logon credentials as in ?CryptProtectData? function. Thanks in advance. Regards, Raja -------------- next part -------------- An HTML attachment was scrubbed... URL: From skrapp at hotmail.com Mon Oct 5 20:45:06 2020 From: skrapp at hotmail.com (nicolas jacky) Date: Tue, 6 Oct 2020 00:45:06 +0000 Subject: [python-win32] Strange issues when using pywin32 to develop solidworks Message-ID: I test below code snippets in vscode with enviroment of python 3.8, pywin32 build 228, solidworks 2017 API sets and created .py files by makepy, I get some strange errors. first snippet # -*- coding: utf-8 -*- from win32com.client import * from pythoncom import * swx = Dispatch("SldWorks.Application") swModel = swx.ActiveDoc mathUilty = swx.GetMathUtility compName = [] Trans = [1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] CoordName = [] compName.append(r'C:\Users\admin\Desktop\abc.SLDASM') CoordName.append('') vtName = VARIANT(VT_VARIANT, compName) vtTrans = VARIANT(VT_VARIANT, Trans) vtCoordName = VARIANT(VT_VARIANT, CoordName) swModel.AddComponents3(vtName,vtTrans,vtCoordName) Running this code and vscode says: line 15, in swModel.AddComponents3(vtName,vtTrans,vtCoordName) TypeError: 'NoneType' object is not callable If I code it like this 'swModel.AddComponents3' then it's ok. the function definition is: System.object AddComponents3( System.object Names, System.object Transforms, System.object CoordinateSystemNames ) second snippet # -*- coding: utf-8 -*- from win32com.client import * from pythoncom import * swx = Dispatch("SldWorks.Application") swModel = swx.ActiveDoc mathUilty = swx.GetMathUtility vtPoint = VARIANT(VT_VARIANT, [100.0,0.0,0.0]) vtVec = VARIANT(VT_VARIANT, [0.0,0.0,1.0]) point = mathUilty.CreatePoint(vtPoint) axis = mathUilty.CreateVector(vtVec) trans = mathUilty.CreateTransformRotateAxis(point,axis,3.14*30.0/180.0) print(trans) Running this code and vscode says: line 9, in __call__ return self._get_good_object_(self._oleobj_.Invoke(*allArgs),self._olerepr_.defaultDispatchName,None) pywintypes.com_error: (-2147352573, 'Member not found.', None, None) the function 'CreatePoint' and 'CreateVector' is not the member of mathuilty, the functions definition are: System.object CreatePoint( System.object ArrayDataIn ) System.object CreateVector( System.object ArrayDataIn ) Could somebody can kindly find out what happened for these issues? thanks very much! And you can find the redist of solidworks inhttp://u.163.com/nnnnnnFnC. access code: fomwl84g -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Oct 7 02:36:36 2020 From: timr at probo.com (Tim Roberts) Date: Tue, 6 Oct 2020 23:36:36 -0700 Subject: [python-win32] AES based win32crypt lib for python3 In-Reply-To: References: Message-ID: <048A27FB-317A-4D30-BDFF-72D95EAF893B@probo.com> On Oct 5, 2020, at 8:24 AM, Raja Sekhar wrote: > > I have seen win32crypt lib for python, And it is built on DES algorithm. Sort of. Triple-DES is used to protect the master key derived from the credentials, but I?ve never seen Microsoft say what they actually use to encrypt the data blob. > I am searching for such library in Python using AES Algorithm. I have gone through pyAesCrypt, Crypto.Cipher which is taking an explicit key for encryption. > I would be grateful if you could help me to find a library in python3, > which uses AES encryption library similar to win32crypt which encrypts data using a session key derived from current user's logon credentials as in ?CryptProtectData? > function. Nope. Remember that win32crypt is nothing but a thin layer that calls the Windows CryptProtectData API. The API does a remote procedure call into the Windows LSA (Local Security Authority) to get access to the login credentials through an undocumented internal function. You can certainly find AES encryption for Python, but it?s not going to use the login credentials. ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Oct 7 02:44:19 2020 From: timr at probo.com (Tim Roberts) Date: Tue, 6 Oct 2020 23:44:19 -0700 Subject: [python-win32] Strange issues when using pywin32 to develop solidworks In-Reply-To: References: Message-ID: <77BE7E53-883B-4173-A00E-20E0BC589F05@probo.com> On Oct 5, 2020, at 5:45 PM, nicolas jacky wrote: > > I test below code snippets in vscode with enviroment of python 3.8, pywin32 build 228, solidworks 2017 API sets and created .py files by makepy, I get some strange errors. > first snippet > > # -*- coding: utf-8 -*- > from win32com.client import * > from pythoncom import * > swx = Dispatch("SldWorks.Application") > swModel = swx.ActiveDoc > mathUilty = swx.GetMathUtility GetMathUtility is a method, not a property. You need to call it as a function: mathUtility = swx.GetMathUtility() ActiveDoc is a property, and so should not need parens. > Running this code and vscode says: > > line 15, in > swModel.AddComponents3(vtName,vtTrans,vtCoordName) > TypeError: 'NoneType' object is not callable > If I code it like this 'swModel.AddComponents3' then it's ok. > What is the difference? ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitry.fedorov at mazars.ru Tue Oct 27 06:34:23 2020 From: dmitry.fedorov at mazars.ru (FEDOROV Dmitry) Date: Tue, 27 Oct 2020 10:34:23 +0000 Subject: [python-win32] Missing letters References: <06c38880-016b-4df0-82c4-3bddb62913f3.69a88201-bc93-4162-be3e-88d3f06ffb72.d9f035b2-1a16-48d9-bbd4-b46032bcd76e@emailsignatures365.codetwo.com> Message-ID: Hello! I wrote the script for reading emails and downloading attachments on everyday basis (50+ emails each day). In general, it's working properly, but sometimes script skips the emails without any reason. Why it might happen? I use application connection outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") And emails extracting from specific folder (I am sure that subject of skipped emails contain test): main_box = outlook.Folders.Item(main_folder) inbox = main_box.Folders.Item(folder) messages = inbox.Items messages = [msg for msg in messages if "test" in msg.Subject.lower()] Kind regards, Dmitry Dmitry FEDOROV Senior Consultant Mazars - Mazars Labs 5, bld. 19, Nizhniy Susalniy Pereulok, Business Center 'Arma' 105064 - Moscow - Russia Tel: +7 (495) 792 5245, +7 (495) 532 2685 Direct line: +74995008014;ext=1120# Mobile: +7 (905) 761 18 94 www.mazars.ru Follow Mazars on LinkedIn - Facebook - YouTube [cid:Mazars_Logo_2C_RGB_c2f2f6a3-11fc-44e9-813c-bdd3c2bea3b3.png] Please consider the environment before printing this email. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. [cid:memail_footer_ru_38ccddf5-17ef-4ae2-b3aa-deb801d5ac07.png] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Mazars_Logo_2C_RGB_c2f2f6a3-11fc-44e9-813c-bdd3c2bea3b3.png Type: image/png Size: 20121 bytes Desc: Mazars_Logo_2C_RGB_c2f2f6a3-11fc-44e9-813c-bdd3c2bea3b3.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: memail_footer_ru_38ccddf5-17ef-4ae2-b3aa-deb801d5ac07.png Type: image/png Size: 423094 bytes Desc: memail_footer_ru_38ccddf5-17ef-4ae2-b3aa-deb801d5ac07.png URL: From momchil at bojinov.info Tue Oct 27 07:30:31 2020 From: momchil at bojinov.info (momchil at bojinov.info) Date: Tue, 27 Oct 2020 13:30:31 +0200 Subject: [python-win32] Help with PySECURITY_DESCRIPTOR Message-ID: <013901d6ac54$965b6250$c31226f0$@bojinov.info> Hello, Newbie here I m trying to store file's acl along with the backup of the file and then restore it on the same system Got this from Mr Tim Golden: # http://timgolden.me.uk/python/win32_how_do_i/add-security-to-a-file.html sd = win32security.GetFileSecurity (FILENAME, win32security.DACL_SECURITY_INFORMATION) but don't see a way to serialize it out of the box. If I call all the Get* methods and store those, will it be enough to restore it ? Regards, Mochil -------------- next part -------------- An HTML attachment was scrubbed... URL: From infomativearchitect at gmail.com Tue Oct 27 20:50:25 2020 From: infomativearchitect at gmail.com (Anthony James) Date: Tue, 27 Oct 2020 20:50:25 -0400 Subject: [python-win32] python-win32 Digest, Vol 210, Issue 3 In-Reply-To: References: Message-ID: Dmitry-- Is the script neglecting only one email or several emails. If several emails are missing are they in series - is there any sort of pattern? Anthony On Tuesday, October 27, 2020, wrote: > Send python-win32 mailing list submissions to > python-win32 at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > python-win32-request at python.org > > You can reach the person managing the list at > python-win32-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. Missing letters (FEDOROV Dmitry) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 27 Oct 2020 10:34:23 +0000 > From: FEDOROV Dmitry > To: "python-win32 at python.org" > Subject: [python-win32] Missing letters > Message-ID: > EURPRD10.PROD.OUTLOOK.COM> > > Content-Type: text/plain; charset="windows-1252" > > Hello! > I wrote the script for reading emails and downloading attachments on > everyday basis (50+ emails each day). > In general, it's working properly, but sometimes script skips the emails > without any reason. Why it might happen? > I use application connection > outlook = win32com.client.Dispatch("Outlook.Application"). > GetNamespace("MAPI") > > And emails extracting from specific folder (I am sure that subject of > skipped emails contain test): > > main_box = outlook.Folders.Item(main_folder) > inbox = main_box.Folders.Item(folder) > messages = inbox.Items > messages = [msg for msg in messages if "test" in msg.Subject.lower()] > > Kind regards, > Dmitry > > > > Dmitry FEDOROV > > Senior Consultant > > > > Mazars - Mazars Labs > > 5, bld. 19, Nizhniy Susalniy Pereulok, Business Center 'Arma' > > 105064 - Moscow - Russia > > Tel: +7 (495) 792 5245, +7 (495) 532 2685 > > Direct line: +74995008014;ext=1120# > > Mobile: +7 (905) 761 18 94 > > > > www.mazars.ru > > > > Follow Mazars on LinkedIn com/company/mazars-in-russia/?viewAsMember=true> - Facebook< > https://www.facebook.com/MazarsRussia> - YouTube com/user/MazarsFrance> > > > > [cid:Mazars_Logo_2C_RGB_c2f2f6a3-11fc-44e9-813c-bdd3c2bea3b3.png]< > https://rus.mazars.ru/> > > > > Please consider the environment before printing this email. This email and > any files transmitted with > > it are confidential and intended solely for the use of the individual or > entity to whom they are addressed. > > > > [cid:memail_footer_ru_38ccddf5-17ef-4ae2-b3aa-deb801d5ac07.png]< > https://www.mazars.ru/Home/About-us/Mazars-announces-global-rebrand> > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20201027/abc77cc6/attachment.html> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Mazars_Logo_2C_RGB_c2f2f6a3-11fc-44e9-813c-bdd3c2bea3b3.png > Type: image/png > Size: 20121 bytes > Desc: Mazars_Logo_2C_RGB_c2f2f6a3-11fc-44e9-813c-bdd3c2bea3b3.png > URL: attachments/20201027/abc77cc6/attachment.png> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: memail_footer_ru_38ccddf5-17ef-4ae2-b3aa-deb801d5ac07.png > Type: image/png > Size: 423094 bytes > Desc: memail_footer_ru_38ccddf5-17ef-4ae2-b3aa-deb801d5ac07.png > URL: attachments/20201027/abc77cc6/attachment-0001.png> > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > > ------------------------------ > > End of python-win32 Digest, Vol 210, Issue 3 > ******************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caiok at outlook.at Fri Oct 30 07:00:37 2020 From: caiok at outlook.at (Caio Kauffmann) Date: Fri, 30 Oct 2020 11:00:37 +0000 Subject: [python-win32] Using python to create outlook rules - comtypes (working) vs. pywin32 (not working) Message-ID: Dear win32 list members, I am a hobby programmer and after days trying to figure out what I am doing wrong, I still can't finish a project because of the issue I listed in this topic in stack overflow: https://stackoverflow.com/questions/64594689/python-comtypes-working-vs-pywin32-not-working-using-python-to-create-o Help would be much appreciated. Thank you so much in advance! Best, Caio -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Oct 30 13:33:26 2020 From: timr at probo.com (Tim Roberts) Date: Fri, 30 Oct 2020 10:33:26 -0700 Subject: [python-win32] Using python to create outlook rules - comtypes (working) vs. pywin32 (not working) In-Reply-To: References: Message-ID: <902104bc-a401-2397-d098-9764ccd0edd4@probo.com> Caio Kauffmann wrote: > > I am a hobby programmer and after days trying to figure out what I am > doing wrong, I still can?t finish a project because of the issue I > listed in this topic in stack overflow: > https://stackoverflow.com/questions/64594689/python-comtypes-working-vs-pywin32-not-working-using-python-to-create-o > This is not Visual Basic.? The following statement does nothing in Python: |oFromCondition.Recipients.ResolveAll| If you want the method to be called, you have to call it: |oFromCondition.Recipients.ResolveAll()| -- 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: 3389 bytes Desc: S/MIME Cryptographic Signature URL: