From qlthai at gmail.com Tue Sep 4 04:53:35 2018 From: qlthai at gmail.com (Quang Thai) Date: Tue, 4 Sep 2018 18:53:35 +1000 Subject: [python-win32] DDE error with Facon Server software when using v220 under Python 3.6.2 Message-ID: Hi everyone, This is my first post on this mailing list! I have a DDE problem that I hope someone could help me out with. We have been using Facon Server software to control and monitor a PLC for a robot at my workplace. The software is freely available here: http://www.fatek.com/en/download.php?f=data/ftp//PLC/Fatek_Server/FaSvr116-16523_en.zip In the past, we used pywin32 v214 under Python 2.7, to communicate with Facon Server via the DDE interface, without any issues. We recently updated all our scripts to use Python 3.6.2, with pywin32 v220. Since then, we get a mysterious DDE error appear in response to Request operations. Everything worked previously under Python 2.7 and pywin32 214. If I write a very simple Python 3.6.2 DDE server with a Poke and Request operation, and invoke it by writing a simple Python 3.6.2 DDE client, then the operations seem to work fine too. So it seems like an interoperability issue between Python 3.6.2/pywin32 220, and the Facon Server software. But we are not sure where the problem is, or what the next step should be to try and solve this. Can anyone help? Here is a very simple code snippet: import win32ui import dde import time MAR_COMM_WRITE_DELAY = 0.300 MAR_COMM_READ_DELAY = 0.300 server = "FaconSvr" topic = 'Channel0.Station0.Group0' # Connect to Facom server dde_server = dde.CreateServer() dde_server.Create(server) conversation = dde.CreateConversation(dde_server) station = conversation.ConnectTo(server, topic) # DDE read of the robot angle time.sleep(MAR_COMM_READ_DELAY) angle = conversation.Request('R57') # RESULTS IN "DDE Error" print('Angle: {}\n'.format(int(angle))) # DDE write of the robot angle new_angle = angle + 10 time.sleep(MAR_COMM_WRITE_DELAY) conversation.Poke('R330', str(int(new_angle))) print('New Angle: {}\n'.format(int(new_angle))) -------------- next part -------------- An HTML attachment was scrubbed... URL: From davor.geci at gmail.com Fri Sep 7 18:27:43 2018 From: davor.geci at gmail.com (Davor Geci) Date: Sat, 8 Sep 2018 00:27:43 +0200 Subject: [python-win32] Your opinion: NEW Python GUI for Windows desktop apps Message-ID: Guys, I would like your opinion about my new project: Virtual Forms & Python. Do you think it is interesting for the Python community or not? To create database forms with 10 lines of Python code. Your opinion would really mean a lot to me. It is still in Beta. Here is a link with a coupon code for a 100 FREE access to the short Udemy introduction course (few Python videos are in Section 3) Thank you in advance. Davor https://www.udemy.com/create-excel-or-python-app-in-minutes-using-virtual-forms/?couponCode=PYTHONF00 Davor Geci, bacc. ing. techn. graph. CEO @ WinPIS j.d.o.o. davor.geci at virtual-forms.com www.virtual-forms.com ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.cetin at yahoo.com Mon Sep 24 12:02:00 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Mon, 24 Sep 2018 16:02:00 +0000 (UTC) Subject: [python-win32] COM: control menu bar References: <19966764.1610499.1537804920915.ref@mail.yahoo.com> Message-ID: <19966764.1610499.1537804920915@mail.yahoo.com> Hi, I am writing a script to automate a program named Golden Software Surfer. I am using import win32com.client in Python during this process. At one point though i can not get past a certain step of my code. The reason is because Surfer's automation utility (Scipter) does not allow that part to be controlled. I could get past this step if i could control the main program's (Surfer) Menu bar. This step just has a couple of processes that all are within the Menu bar itself. For example here is what I want to automate:****** 1) Arrange | Edit Group2) Edit | Select All 3) Geoprocessing | Change Boundaries | Polyline to Polygon4) Geoprocessing | edit Boundaries | Combine Islands / Lakes5) Arrange | Stop Editting Group****** All of these steps aren't changeable via its scripting libraries within Scripter. But they are all under the main programs Menu Bar. Is there a way for me to automate the menubar via win32com? If so could you please help me understand how? Basically i am trying to learn how to control the menu bar of Surfer from Python. Thank you all in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simonmcconnell at gmail.com Mon Sep 24 18:32:28 2018 From: simonmcconnell at gmail.com (Simon McConnell) Date: Tue, 25 Sep 2018 08:32:28 +1000 Subject: [python-win32] COM: control menu bar In-Reply-To: <19966764.1610499.1537804920915@mail.yahoo.com> References: <19966764.1610499.1537804920915.ref@mail.yahoo.com> <19966764.1610499.1537804920915@mail.yahoo.com> Message-ID: I haven't used it myself but I believe this is what pywinauto does: http://pywinauto.github.io On Tue, 25 Sep 2018 at 02:04 Emre CETIN via python-win32 < python-win32 at python.org> wrote: > Hi, I am writing a script to automate a program named Golden Software > Surfer. I am using import win32com.client in Python during this process. > At one point though i can not get past a certain step of my code. The > reason is because Surfer's automation utility (Scipter) does not allow that > part to be controlled. I could get past this step if i could control the > main program's (Surfer) Menu bar. This step just has a couple of processes > that all are within the Menu bar itself. For example here is what I want to > automate: > ****** > 1) Arrange | Edit Group > 2) Edit | Select All > 3) Geoprocessing | Change Boundaries | Polyline to Polygon > 4) Geoprocessing | edit Boundaries | Combine Islands / Lakes > 5) Arrange | Stop Editting Group > ****** > All of these steps aren't changeable via its scripting libraries within > Scripter. But they are all under the main programs Menu Bar. Is there a way > for me to automate the menubar via win32com? If so could you please help me > understand how? > > Basically i am trying to learn how to control the menu bar of Surfer from > Python. > > Thank you all in advance. > > _______________________________________________ > 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 e.cetin at yahoo.com Tue Sep 25 10:39:44 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Tue, 25 Sep 2018 14:39:44 +0000 (UTC) Subject: [python-win32] COM: control menu bar In-Reply-To: References: <19966764.1610499.1537804920915.ref@mail.yahoo.com> <19966764.1610499.1537804920915@mail.yahoo.com> Message-ID: <538479358.2227854.1537886384294@mail.yahoo.com> Hello Simon. Thank you for your response. I had read of pywinauto but hadn't used it before. After your advise i have been working on it for hours. But unfortunately i can not get the menu items. I analyzed it via a tool named Swapy and it shows the MenuItems field [] as an empty list. I'm still stuck :/ E m r e On Tuesday, September 25, 2018, 1:33:01 AM GMT+3, Simon McConnell wrote: I haven't used it myself but I believe this is what pywinauto does:? http://pywinauto.github.io On Tue, 25 Sep 2018 at 02:04 Emre CETIN via python-win32 wrote: Hi, I am writing a script to automate a program named Golden Software Surfer. I am using import win32com.client in Python during this process. At one point though i can not get past a certain step of my code. The reason is because Surfer's automation utility (Scipter) does not allow that part to be controlled. I could get past this step if i could control the main program's (Surfer) Menu bar. This step just has a couple of processes that all are within the Menu bar itself. For example here is what I want to automate:****** 1) Arrange | Edit Group2) Edit | Select All 3) Geoprocessing | Change Boundaries | Polyline to Polygon4) Geoprocessing | edit Boundaries | Combine Islands / Lakes5) Arrange | Stop Editting Group****** All of these steps aren't changeable via its scripting libraries within Scripter. But they are all under the main programs Menu Bar. Is there a way for me to automate the menubar via win32com? If so could you please help me understand how? Basically i am trying to learn how to control the menu bar of Surfer from Python. Thank you all in advance. _______________________________________________ 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 mhammond at skippinet.com.au Fri Sep 28 02:52:54 2018 From: mhammond at skippinet.com.au (Mark Hammond) Date: Fri, 28 Sep 2018 16:52:54 +1000 Subject: [python-win32] [ANN] pywin32 build 224 released Message-ID: Hi all, I'm happy to announce the release of pywin32 build 224. There are a few changes in this release, but the most significant one is that many "date" related issues with build 223 in Python 3.7 should be fixed. This should help when installing pywin32 via pypi. While I still consider wheel support to be experimental, I encourage everyone to try it out and report any issues via https://github.com/mhammond/pywin32/issues. Downloads are available at: https://github.com/mhammond/pywin32/releases/tag/b224 and via pypi. 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: * Built with a released version of Python 3.7, which fixes various date related issues with Python 3.7 * Fix a regression introduced in build 220 around how some COM properties are handled (#1211 and #1199) * Everything is now build with the Windows 8.1 SDK. While this should typically be invisible, it is mentioned because it might explain obscure issues that creep in, so it should be explicitly called out as a change. On the plus side, this makes building the extensions far simpler. * win32serviceutil - in GetServiceClassString, skip rewrite of file name (fname) when win32api.FindFiles returns an empty list, e.g., if the service has been packaged in a zip or exe. (fixes issue #642) From e.cetin at yahoo.com Fri Sep 28 18:10:25 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Fri, 28 Sep 2018 22:10:25 +0000 (UTC) Subject: [python-win32] COM: control menu bar In-Reply-To: <538479358.2227854.1537886384294@mail.yahoo.com> References: <19966764.1610499.1537804920915.ref@mail.yahoo.com> <19966764.1610499.1537804920915@mail.yahoo.com> <538479358.2227854.1537886384294@mail.yahoo.com> Message-ID: <647633023.1177159.1538172625197@mail.yahoo.com> I finally was able to get the menu controlled. pywinauto does seem to allow it. After finding the correct connection, this let me select the menu: app_dialog.child_window(title="Menu Bar").set_focus() from there is was a matter of controlling the keyboard with the SendKeys() command. E m r e On Tuesday, September 25, 2018, 5:40:49 PM GMT+3, Emre CETIN via python-win32 wrote: Hello Simon. Thank you for your response. I had read of pywinauto but hadn't used it before. After your advise i have been working on it for hours. But unfortunately i can not get the menu items. I analyzed it via a tool named Swapy and it shows the MenuItems field [] as an empty list. I'm still stuck :/ E m r e On Tuesday, September 25, 2018, 1:33:01 AM GMT+3, Simon McConnell wrote: I haven't used it myself but I believe this is what pywinauto does:? http://pywinauto.github.io On Tue, 25 Sep 2018 at 02:04 Emre CETIN via python-win32 wrote: Hi, I am writing a script to automate a program named Golden Software Surfer. I am using import win32com.client in Python during this process. At one point though i can not get past a certain step of my code. The reason is because Surfer's automation utility (Scipter) does not allow that part to be controlled. I could get past this step if i could control the main program's (Surfer) Menu bar. This step just has a couple of processes that all are within the Menu bar itself. For example here is what I want to automate:****** 1) Arrange | Edit Group2) Edit | Select All 3) Geoprocessing | Change Boundaries | Polyline to Polygon4) Geoprocessing | edit Boundaries | Combine Islands / Lakes5) Arrange | Stop Editting Group****** All of these steps aren't changeable via its scripting libraries within Scripter. But they are all under the main programs Menu Bar. Is there a way for me to automate the menubar via win32com? If so could you please help me understand how? Basically i am trying to learn how to control the menu bar of Surfer from Python. Thank you all in advance. _______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 _______________________________________________ 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 james at jls-radio.com Fri Sep 28 18:54:42 2018 From: james at jls-radio.com (James Scholes) Date: Fri, 28 Sep 2018 23:54:42 +0100 Subject: [python-win32] COM: control menu bar In-Reply-To: <647633023.1177159.1538172625197@mail.yahoo.com> References: <19966764.1610499.1537804920915.ref@mail.yahoo.com> <19966764.1610499.1537804920915@mail.yahoo.com> <538479358.2227854.1537886384294@mail.yahoo.com> <647633023.1177159.1538172625197@mail.yahoo.com> Message-ID: Emre CETIN via python-win32 wrote: > from there is was a matter of controlling the keyboard with the > SendKeys() command. This seems pretty fragile at best. If the menu bar is a standard Windows control, the window will respond to WM_COMMAND messages and carry out the appropriate menu command without you having to send keyboard keys. You'll need to use a tool like Spy++ to log the window messages while you manually activate the menu commands, in order to determine the correct IDs for the items you need. > > *E m r e* > > > On Tuesday, September 25, 2018, 5:40:49 PM GMT+3, Emre CETIN via > python-win32 wrote: > > > Hello Simon. Thank you for your response. I had read of pywinauto but > hadn't used it before. After your advise i have been working on it for > hours. But unfortunately i can not get the menu items. I analyzed it via > a tool named Swapy and it shows the MenuItems field [] as an empty list. > I'm still stuck :/ > > *E m r e* > > > On Tuesday, September 25, 2018, 1:33:01 AM GMT+3, Simon McConnell > wrote: > > > I haven't used it myself but I believe this is what pywinauto does: > http://pywinauto.github.io > > On Tue, 25 Sep 2018 at 02:04 Emre CETIN via python-win32 > > wrote: > > Hi, I am writing a script to automate a program named Golden > Software Surfer. I am using import win32com.client in Python during > this process. At one point though i can not get past a certain step > of my code. The reason is because Surfer's automation utility > (Scipter) does not allow that part to be controlled. I could get > past this step if i could control the main program's (Surfer) Menu > bar. This step just has a couple of processes that all are within > the Menu bar itself. For example here is what I want to automate: > ****** > 1) Arrange | Edit Group > 2) Edit | Select All > 3) Geoprocessing | Change Boundaries | Polyline to Polygon > 4) Geoprocessing | edit Boundaries | Combine Islands / Lakes > 5) Arrange | Stop Editting Group > ****** > All of these steps aren't changeable via its scripting libraries > within Scripter. But they are all under the main programs Menu Bar. > Is there a way for me to automate the menubar via win32com? If so > could you please help me understand how? > > Basically i am trying to learn how to control the menu bar of Surfer > from Python. > > Thank you all in advance. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > Regards, James Scholes https://twitter.com/JamesScholes From e.cetin at yahoo.com Sun Sep 30 09:25:38 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Sun, 30 Sep 2018 13:25:38 +0000 (UTC) Subject: [python-win32] COM: control menu bar In-Reply-To: <53641a38-023f-8f29-42a2-4abef3584992@jls-radio.com> References: <19966764.1610499.1537804920915.ref@mail.yahoo.com> <19966764.1610499.1537804920915@mail.yahoo.com> <538479358.2227854.1537886384294@mail.yahoo.com> <647633023.1177159.1538172625197@mail.yahoo.com> <53641a38-023f-8f29-42a2-4abef3584992@jls-radio.com> Message-ID: <1583534365.1642764.1538313938742@mail.yahoo.com> Hello James. Thank you for your advice. I ran Spy++. At the logging options I selected the menu bar portion of the other program. I selected WM_COMMAND only and then chose? all "Additional Windows" (except for the All Windows in System). Then I clicked one of the menu items I wanted: Edit | Select All. It provided me with the following line: WM_COMMAND wNotifyCode:0 (sent from a menu) wID:57642. How can I use this class ID (57642) in Python to act as if it was clicked/pressed? E m r e On Saturday, September 29, 2018, 1:55:37 AM GMT+3, James Scholes wrote: Emre CETIN via python-win32 wrote: > from there is was a matter of controlling the keyboard with the > SendKeys() command. This seems pretty fragile at best.? If the menu bar is a standard Windows control, the window will respond to WM_COMMAND messages and carry out the appropriate menu command without you having to send keyboard keys.? You'll need to use a tool like Spy++ to log the window messages while you manually activate the menu commands, in order to determine the correct IDs for the items you need. > > *E m r e* > > > On Tuesday, September 25, 2018, 5:40:49 PM GMT+3, Emre CETIN via > python-win32 wrote: > > > Hello Simon. Thank you for your response. I had read of pywinauto but > hadn't used it before. After your advise i have been working on it for > hours. But unfortunately i can not get the menu items. I analyzed it via > a tool named Swapy and it shows the MenuItems field [] as an empty list. > I'm still stuck :/ > > *E m r e* > > > On Tuesday, September 25, 2018, 1:33:01 AM GMT+3, Simon McConnell > wrote: > > > I haven't used it myself but I believe this is what pywinauto does: > http://pywinauto.github.io > > On Tue, 25 Sep 2018 at 02:04 Emre CETIN via python-win32 > > wrote: > >? ? Hi, I am writing a script to automate a program named Golden >? ? Software Surfer. I am using import win32com.client in Python during >? ? this process. At one point though i can not get past a certain step >? ? of my code. The reason is because Surfer's automation utility >? ? (Scipter) does not allow that part to be controlled. I could get >? ? past this step if i could control the main program's (Surfer) Menu >? ? bar. This step just has a couple of processes that all are within >? ? the Menu bar itself. For example here is what I want to automate: >? ? ****** >? ? 1) Arrange | Edit Group >? ? 2) Edit | Select All >? ? 3) Geoprocessing | Change Boundaries | Polyline to Polygon >? ? 4) Geoprocessing | edit Boundaries | Combine Islands / Lakes >? ? 5) Arrange | Stop Editting Group >? ? ****** >? ? All of these steps aren't changeable via its scripting libraries >? ? within Scripter. But they are all under the main programs Menu Bar. >? ? Is there a way for me to automate the menubar via win32com? If so >? ? could you please help me understand how? > >? ? Basically i am trying to learn how to control the menu bar of Surfer >? ? from Python. > >? ? Thank you all in advance. > >? ? _______________________________________________ >? ? python-win32 mailing list >? ? python-win32 at python.org >? ? https://mail.python.org/mailman/listinfo/python-win32 > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > Regards, James Scholes https://twitter.com/JamesScholes -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Sun Sep 30 23:40:49 2018 From: timr at probo.com (Tim Roberts) Date: Sun, 30 Sep 2018 20:40:49 -0700 Subject: [python-win32] COM: control menu bar In-Reply-To: <1583534365.1642764.1538313938742@mail.yahoo.com> References: <19966764.1610499.1537804920915.ref@mail.yahoo.com> <19966764.1610499.1537804920915@mail.yahoo.com> <538479358.2227854.1537886384294@mail.yahoo.com> <647633023.1177159.1538172625197@mail.yahoo.com> <53641a38-023f-8f29-42a2-4abef3584992@jls-radio.com> <1583534365.1642764.1538313938742@mail.yahoo.com> Message-ID: <5B334EA2-F8EF-4B79-8D2E-16E45826DF4D@probo.com> On Sep 30, 2018, at 6:25 AM, Emre CETIN via python-win32 wrote: > > Hello James. Thank you for your advice. I ran Spy++. At the logging options I selected the menu bar portion of the other program. I selected WM_COMMAND only and then chose all "Additional Windows" (except for the All Windows in System). Then I clicked one of the menu items I wanted: Edit | Select All. It provided me with the following line: WM_COMMAND wNotifyCode:0 (sent from a menu) wID:57642. > > How can I use this class ID (57642) in Python to act as if it was clicked/pressed? That's not a class ID, it's a window ID. You can trigger that by sending the exact same message you saw here. ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: