From sahhithis25 at gmail.com Sun Jan 7 01:21:30 2018 From: sahhithis25 at gmail.com (sahhithi sangitapu) Date: Sun, 7 Jan 2018 11:51:30 +0530 Subject: [python-win32] Python program to consolidate the.eml files Message-ID: Hello, I would like to write a program in python to read the whole contents with images from the outlook email which has been saved in local drive and form an single email message from all the outlook message from the local drive Could you please let me know on this. Thanks ,Sahithi -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue Jan 9 13:19:42 2018 From: timr at probo.com (Tim Roberts) Date: Tue, 9 Jan 2018 10:19:42 -0800 Subject: [python-win32] Python program to consolidate the.eml files In-Reply-To: References: Message-ID: <4c393490-78c8-1b3d-fa5a-4da612f5f7ce@probo.com> sahhithi sangitapu wrote: > > I would like to write a program in python to read the whole contents > with images from the outlook email which has been saved in local drive > and form an single email message from all the outlook message from the > local drive Your request is a little confusing.? EML files are basically plain text in RFC 822 format, like the Unix "mbox" format.? The easy way to transport them is just to combine them into a zip file and send the zip file.? What do you plan to do with these messages?? Why do you think you need to convert them to a single email? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From durumdara at gmail.com Thu Jan 11 07:37:44 2018 From: durumdara at gmail.com (Durumdara) Date: Thu, 11 Jan 2018 13:37:44 +0100 Subject: [python-win32] Recycle bin deletion date - mixing shell and winshell? Message-ID: Dear Members! I tried to find a way to get the file deletion date from recycle bin files. As I see the IShellFolder's GetDisplayNameOf don't give me data about it, only original and real filename. The winshell module ( https://winshell.readthedocs.io/en/latest/recycle-bin.html) retreives recycle bin files for me, I can see the deletion date, but not the real filename in filesystem (to I can delete the older ones). Now I may mix the two modes with a dict which full of the uppercased original filenames, and I may look up all real filenames, but it would be better if I could handle whole thing in one module. Does PyWin supports the get "deletion date" from a Recycle Bin file? As I read somewhere it needs IShellFolder2 interface, but I may remember wrong. Thank you Best Regards dd -------------- next part -------------- An HTML attachment was scrubbed... URL: From Yann.Schoeni at moutier.ch Thu Jan 11 10:12:33 2018 From: Yann.Schoeni at moutier.ch (Schoeni, Yann) Date: Thu, 11 Jan 2018 15:12:33 +0000 Subject: [python-win32] Python - connexion to serial port Message-ID: Hey there ! I've a web application which needs to send data to a serial port. The webserver uses ajax to send data to a python script. The Python script uses the serial module to open, send data, and close the serial port. Is there a way to keep the serial port open ? Because for now, I open/close it between each transaction and I need to be 100% sure the data package will be send .. which is not the case with my actual python script. Thank you in advance for your answer. Best wishes Yann Schoeni Municipalit? de Moutier Apprenti informaticien T?l. +41 (0)32 494 11 69 Mob. +41 (0)79 827 30 86 E-mail yann.schoeni at moutier.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From planders at gmail.com Thu Jan 11 11:07:55 2018 From: planders at gmail.com (Preston Landers) Date: Thu, 11 Jan 2018 16:07:55 +0000 Subject: [python-win32] Python - connexion to serial port In-Reply-To: References: Message-ID: You could have a worker thread or process that keeps the serial port open and listens for jobs on some kind of task queue. However it's not clear to me how keeping the serial port open between requests provides assurance of data integrity. On Thu, Jan 11, 2018 at 9:27 AM Schoeni, Yann wrote: > Hey there ! > > > > I?ve a web application which needs to send data to a serial port. The > webserver uses ajax to send data to a python script. > > > > The Python script uses the serial module to open, send data, and close the > serial port. > > > > *Is there a way to keep the serial port open ? * > > > > Because for now, I open/close it between each transaction and I need to be > 100% sure the data package will be send .. which is not the case with my > actual python script. > > > > Thank you in advance for your answer. > > > > Best wishes > > > > *Yann Schoeni* > > *Municipalit? de Moutier * > > Apprenti informaticien > > T?l. +41 (0)32 494 11 69 <+41%2032%20494%2011%2069> > > Mob. +41 (0)79 827 30 86 <+41%2079%20827%2030%2086> > > E-mail yann.schoeni at moutier.ch > > > _______________________________________________ > 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 Thu Jan 11 12:59:29 2018 From: timr at probo.com (Tim Roberts) Date: Thu, 11 Jan 2018 09:59:29 -0800 Subject: [python-win32] Recycle bin deletion date - mixing shell and winshell? In-Reply-To: References: Message-ID: Durumdara wrote: > > The winshell module > (https://winshell.readthedocs.io/en/latest/recycle-bin.html)?retreives > recycle bin files for me, I can see the deletion date, but not the > real filename in filesystem (to I can delete the older ones). The documentation does not describe it, but if you look in the source code (which should always be your fallback for True Answers), you'll see that the ShellRecycledItem object has a real_filename() method that returns the information you want. The documentation is on github, if you want to submit a fix. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From Yann.Schoeni at moutier.ch Fri Jan 12 05:00:02 2018 From: Yann.Schoeni at moutier.ch (Schoeni, Yann) Date: Fri, 12 Jan 2018 10:00:02 +0000 Subject: [python-win32] Python - connexion to serial port Message-ID: Hey, ? is the Python script persistent (is it running continuously in the background) or launched for each transaction? ? - Currently, the script is launched for each transaction. As I understand your proposition, when the web page is open, an ajax request should call a python script which open a thread between the machine and the serial peripheral, right ? - is it hard to code this kind of mechanism ? To be honest I've never worked with thread. - Even if I find a way to open a thread with the serial port or to keep it open with a loop, is it possible to send it orders ? - Is there someone who has already experience that kind of situation ? Thank you for your answer. Best wishes Yann Schoeni Municipalit? de Moutier Apprenti informaticien T?l. +41 (0)32 494 11 69 Mob. +41 (0)79 827 30 86 E-mail yann.schoeni at moutier.ch -----Message d'origine----- De : python-win32 [mailto:python-win32-bounces+yann.schoeni=moutier.ch at python.org] De la part de Dennis Lee Bieber Envoy? : jeudi, 11 janvier 2018 17:37 ? : python-win32 at python.org Objet : Re: [python-win32] Python - connexion to serial port On Thu, 11 Jan 2018 15:12:33 +0000, "Schoeni, Yann" declaimed the following: >I've a web application which needs to send data to a serial port. The webserver uses ajax to send data to a python script. > >The Python script uses the serial module to open, send data, and close the serial port. > >Is there a way to keep the serial port open ? > >Because for now, I open/close it between each transaction and I need to be 100% sure the data package will be send .. which is not the case with my actual python script. > First question: is the Python script persistent (is it running continuously in the background) or launched for each transaction? For the former (continuous background) why can't you just open the port at the start of the process and leave it open; looping around just the transaction processing. If the latter -- not really, as even if you didn't close the port, the script shutdown will. You would have to create a separate long-term process (not thread, as the thread would have to exit to let the Python script terminate in this scenario). Your Python script would have to transfer the data to be written to the long-term process and let it do the serial port handling. I'm not certain how you'd handle the transfer... All the IPC examples in the multiprocessing library are predicated upon one Python script starting the other process(es) and passing identifiers for the IPC channels (queue, pipes) to the subprocess. Perhaps by having the long-term process create a multiprocessing.manager instance configured for "remote connection" (even if the connection is localhost for both ends), and which the transaction script then attaches. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed at ix.netcom.com HTTP://wlfraed.home.netcom.com/ _______________________________________________ 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 Paul.Koning at dell.com Thu Jan 11 12:30:38 2018 From: Paul.Koning at dell.com (Paul.Koning at dell.com) Date: Thu, 11 Jan 2018 17:30:38 +0000 Subject: [python-win32] Python - connexion to serial port In-Reply-To: References: Message-ID: > On Jan 11, 2018, at 11:36 AM, Dennis Lee Bieber wrote: > > On Thu, 11 Jan 2018 15:12:33 +0000, "Schoeni, Yann" > declaimed the following: > >> I've a web application which needs to send data to a serial port. The webserver uses ajax to send data to a python script. >> >> The Python script uses the serial module to open, send data, and close the serial port. >> >> Is there a way to keep the serial port open ? >> >> Because for now, I open/close it between each transaction and I need to be 100% sure the data package will be send .. which is not the case with my actual python script. I'd add one observation: while you can be reasonably sure that data is sent if you ask the serial port to send it, that does NOT mean it will be received. I suspect what is actually needed is a guarantee that the data is received. A serial port does not offer that guarantee. If the hardware is clean, it only offers a high probability. If you want guarantees, you need a data checking and acknowledgement protocol, like DDCMP or TCP or DECnet. paul From timr at probo.com Fri Jan 12 14:01:03 2018 From: timr at probo.com (Tim Roberts) Date: Fri, 12 Jan 2018 11:01:03 -0800 Subject: [python-win32] Python - connexion to serial port In-Reply-To: References: Message-ID: <9194d44e-5d22-a719-5738-509b76ab24f8@probo.com> Schoeni, Yann wrote: > ? > > ??is the Python script persistent (is it running continuously in the > background) or launched for each transaction??? > > ? > > -?????? Currently, the script is launched for each transaction. As I > understand your proposition, when the web page is open, > > ?? ????an ajax request should call a python script which open a thread > between the machine and the serial peripheral, right ? > I'm still not clear what problems you are seeing with the open/send/close paradigm.? What leads you to make a change?? The open/send/close model is usually easier to handle, because the process starts with a clean slate every time.? Once you go to a long-running process, you have more things to keep track of. Dennis is not necessarily proposing a new thread.? Consider, for example, a server application using one of the frameworks, like Flask or CherryPy or Django.? Such an application gets launched once, and sits idle waiting for to send it things to do.? When it gets a request (either from a socket or routed from Apache), it reads input, takes action, sends output, then waits for more things to do. Dennis' proposal is the same.? Have a Python script running continuously.? When an Ajax request comes in (either from a socket or from Apache), you communicate with the serial port and send your response.? The serial port can remain open, because the application does not close. But I'm not convinced that complexity is needed.? The open/send/close model should work just fine. > -?????? Even if I find a way to open a thread with the serial port or > to keep it open with a loop, is it possible to send it orders ? Why wouldn't it? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From Yann.Schoeni at moutier.ch Mon Jan 15 04:48:32 2018 From: Yann.Schoeni at moutier.ch (Schoeni, Yann) Date: Mon, 15 Jan 2018 09:48:32 +0000 Subject: [python-win32] Python - connexion to serial port Message-ID: <84a240df71e64c8cb1ce5cb058011c71@moutier.ch> Ok guys, I'm gonna try to give you a full explanation. I thought it would be a great idea to keep it open during the application life time for one reason. My webserver (running on windows) got a Velleman VM8090 module plugged in with a usb cable, my serial port is virtual. Working process : 1) A QR code is read by a QR code reader 2) The QR code is paste into an input field and send to a controller 3) The controller checks the validity of the code in agreement with a database 4) If the code is approuved the controller use shell_exec to open a python command line 5) A python script is call with args like this : Python C:\temp\gate.py on 6) Every time the script is launch, it open the serial port, send the command depending on the argument and close it. 7) Sometimes, the script return < The Serial port is already open >, and a delay is identified. Below the function that open the port : def open_device() : try: print("Opening serial port") ser = serial.Serial( port='COM200', baudrate=19200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, ) except IOError: print("Serial port already open !") ser.close() ser.open() return ser 8) Because of this delay I was just thinking about keeping the serial port open while the application is running. What do you guys think ? $ Best wishes ! Yann Schoeni -------------- next part -------------- An HTML attachment was scrubbed... URL: From durumdara at gmail.com Mon Jan 15 03:13:43 2018 From: durumdara at gmail.com (Durumdara) Date: Mon, 15 Jan 2018 09:13:43 +0100 Subject: [python-win32] Recycle bin deletion date - mixing shell and winshell? In-Reply-To: References: Message-ID: Dear Members! Thank you for "real_filename" info! It is working well! Best regars dd -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Mon Jan 15 12:09:22 2018 From: timr at probo.com (Tim Roberts) Date: Mon, 15 Jan 2018 09:09:22 -0800 Subject: [python-win32] Python - connexion to serial port In-Reply-To: <84a240df71e64c8cb1ce5cb058011c71@moutier.ch> References: <84a240df71e64c8cb1ce5cb058011c71@moutier.ch> Message-ID: <034c5c01-cb2d-19ad-eec1-13bf4ffc76b6@probo.com> Schoeni, Yann wrote: > ?? > > I thought it would be a great idea to keep it open during the > application life time for one reason. > > ? > > My webserver (running on windows) got a Velleman VM8090 module plugged > in with a usb cable, my serial port is virtual. > > ? > > 7)????? Sometimes, the script return ??The Serial port is already > open??, and a *delay is identified*. Below the function that open the > port?:? > > 8)????? Because of this delay I was just thinking about keeping the > serial port open while the application is running. > > ? > > What do you guys think?? $ > There are two possible solutions. The only time the port should be open is if you are already processing another request.? No matter what you do, there's always going to be a delay in that case.? Your problem, then, is to serialize access to the serial port, to ensure there's only one request at a time. Your proposed solution is certainly workable.? You could create a long-running "serial server" that keeps the serial port open and accepts requests from your web server.? The other solution is to change your script so that IT keeps retrying until it's able to open the port, with a short delay between each attempt.? That way, the web server would always see success. The delay with the two solutions should be about the same; you're always going to have to wait for request A to finish before request B starts, but the second solution would be easier, from where you are now. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mhammond at skippinet.com.au Sun Jan 21 01:18:34 2018 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sun, 21 Jan 2018 17:18:34 +1100 Subject: [python-win32] [ANN] pywin32 build 222 released Message-ID: <4eab6922-d0df-63ba-bd56-1c6d9293c71b@skippinet.com.au> Hi all, I'm happy to announce the release of pywin32 build 222. There are some notable changes with this release: We have moved to github for development and releases. https://github.com/mhammond/pywin32 is the new home of pywin32 and all builds will be released there. The build process now also builds "wheels", so "pip install pywin32" should also work - note that this support is EXPERIMENTAL - I still recommend you use the binary (ie, .exe installers) [Note: I'm struggling with PyPi refusing to allow me to upload the 3.7-64bit wheel, but hopefully this will be fixed soon] Particular thanks to @xoviat, who helped with prompting me to make the change, imported all the issues from sourceforge, and helped with the process for creating the wheels. Note also that older Python versions are no longer supported - builds are only made available for Python 2.7 and Python 3.5+. As usual, this release also addresses a number of bugs with previous builds - I've appended the change log at the end of this mail. Downloads are available at: https://github.com/mhammond/pywin32/releases/tag/b222 For initial support (eg, to ask questions about the release etc), please contact this mailing-list (python-win32 at python.org). If you want to report a bug, please do so at https://github.com/mhammond/pywin32/issues As always, thanks to everyone who contributed to this release, both in terms of code and reporting bugs. Cheers, Mark. Changes: Since build 221: ---------------- * !! Moved to github for development !!. https://github.com/mhammond/pywin32 is the new home of pywin32 and all builds will be released there. The build process now also builds "wheels", so "pip install pywin32" should also work (but see README.md for some limitiations of using pip) Particular thanks to @xoviat, who helped with prompting me to make the change, imported all the issues from sourceforge, and helped with the process for creating the wheels. As a part of this, I've changed every issue in this file from "#xxx" to "#sfxxx" to indicate they refer to the old sourceforge issue numbers. * Older Python versions are no longer supported - builds are only made available for Python 2.7 and Python 3.5+. * For Python 3.x, a win32 FILETIME or TimeStamp which is greater than the datetime module can handle will return datetime.datetime.max instead of throwing (fixes issue #748) * win32file - fix ERROR_BAD_LENGTH in GetFileInformationByHandleEx in x86 builds(issue #752, rbschk) * MakeModuleForTypelib no longer catches COM exceptions, so no longer can return None. This is what the docstring always claimed the behaviour was and makes things less error prone. If you explicitly call this function and handle None, you will need to wrap the call in an exception handler. * Change PyIMAPIFolder CopyMessages, DeleteMessages, and EmptyFolder to return the HRESULT (Nick Czeczulin via patch #sf162) * Fix a reference leak of Py_None in a couple of MAPI methods (Nick Czeczulin via patch #sf149) From Samantha.Mait at spacex.com Wed Jan 31 11:50:26 2018 From: Samantha.Mait at spacex.com (Samantha Mait) Date: Wed, 31 Jan 2018 16:50:26 +0000 Subject: [python-win32] Pywin32 outlook email organizer Message-ID: <89130e32f8ca4912b19f2917555cffc1@HT1-EX02.spacex.corp> Hello, I am reaching out as I am trying to use the pywin32 package for python 2.7 to automate sending an outlook calendar invite. The package is awesome and is able to do everything I would like except for one piece. I am trying to send the email from a separate email address. Is there any way that I can do this? Ideally, I would like the email to be able to generate the script on my computer, but have the sender be someone else like you can do in python's email package via sendmail(from_addresss, [to_address], msg.as_string()). I just posted the question here on Stack Overflow: https://stackoverflow.com/q/48532975/9274889 If you would be able to assist me with this task, I would very much appreciate it-I have been trying to figure it out for the last week and a half. I look forward to hearing from you. All the best, Samantha Mait -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Jan 31 16:13:13 2018 From: timr at probo.com (Tim Roberts) Date: Wed, 31 Jan 2018 13:13:13 -0800 Subject: [python-win32] Pywin32 outlook email organizer In-Reply-To: <89130e32f8ca4912b19f2917555cffc1@HT1-EX02.spacex.corp> References: <89130e32f8ca4912b19f2917555cffc1@HT1-EX02.spacex.corp> Message-ID: Samantha Mait wrote: > > ? > > I am reaching out as I am trying to use the pywin32 package for python > 2.7 to automate sending an outlook calendar invite. The package is > awesome and is able to do everything I would like except for one > piece. I am trying to send the email from a separate email address. Is > there any way that I can do this? > > ? > > Ideally, I would like the email to be able to generate the script on > my computer, but have the sender be someone else like you can do in > python?s email package via sendmail(from_addresss, [to_address], > msg.as_string()). > Remember that Python is just a gateway into Outlook.? You can't do anything that Outlook wouldn't ordinarily do, and Outlook doesn't allow you to override the sender address.? You can set up multiple identities in Outlook, and then use Python to choose which identity to use when sending. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From toddfiske at gmail.com Wed Jan 31 20:29:50 2018 From: toddfiske at gmail.com (Todd Fiske) Date: Wed, 31 Jan 2018 20:29:50 -0500 Subject: [python-win32] Pywin32 outlook email organizer In-Reply-To: References: <89130e32f8ca4912b19f2917555cffc1@HT1-EX02.spacex.corp> Message-ID: In an Exchange environment (Office 365), I have to give myself SendAs permission (or Full Access) for Outlook to allow this. The code to set the field is: msg = ol.CreateItemFromTemplate(templateFile, folder) ... msg.SentOnBehalfOfName = "groupbox at company.com" Todd On Wed, Jan 31, 2018 at 4:13 PM, Tim Roberts wrote: > Samantha Mait wrote: > > > > > > > > I am reaching out as I am trying to use the pywin32 package for python > > 2.7 to automate sending an outlook calendar invite. The package is > > awesome and is able to do everything I would like except for one > > piece. I am trying to send the email from a separate email address. Is > > there any way that I can do this? > > > > > > > > Ideally, I would like the email to be able to generate the script on > > my computer, but have the sender be someone else like you can do in > > python?s email package via sendmail(from_addresss, [to_address], > > msg.as_string()). > > > > Remember that Python is just a gateway into Outlook. You can't do > anything that Outlook wouldn't ordinarily do, and Outlook doesn't allow > you to override the sender address. You can set up multiple identities > in Outlook, and then use Python to choose which identity to use when > sending. > > -- > 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 j.orponen at 4teamwork.ch Wed Jan 31 12:45:20 2018 From: j.orponen at 4teamwork.ch (Joni Orponen) Date: Wed, 31 Jan 2018 18:45:20 +0100 Subject: [python-win32] Pywin32 outlook email organizer In-Reply-To: <89130e32f8ca4912b19f2917555cffc1@HT1-EX02.spacex.corp> References: <89130e32f8ca4912b19f2917555cffc1@HT1-EX02.spacex.corp> Message-ID: On Wed, Jan 31, 2018 at 5:50 PM, Samantha Mait wrote: > I am reaching out as I am trying to use the pywin32 package for python 2.7 > to automate sending an outlook calendar invite. The package is awesome and > is able to do everything I would like except for one piece. I am trying to > send the email from a separate email address. Is there any way that I can > do this? > > > > Ideally, I would like the email to be able to generate the script on my > computer, but have the sender be someone else like you can do in python?s > email package via sendmail(from_addresss, [to_address], msg.as_string()). > Microsoft provides a COM interface for Outlook. https://msdn.microsoft.com/en-us/library/office/aa220082 https://msdn.microsoft.com/en-us/library/office/dn320330 Calling CreateItem on the COM dispatch returns you a MailItem, for which you can set the Sender. This might get you there in regards to creating and sending email. I'm not fully certain on how the calendar invites actually work in Outlook, but if there is a need to hook deeper into the (potential) backing Exchange server, Microsoft provides MAPI for that. https://msdn.microsoft.com/en-us/library/office/cc815424 https://msdn.microsoft.com/en-us/library/office/cc765775 -- Joni Orponen -------------- next part -------------- An HTML attachment was scrubbed... URL: