Altor

Is possible read output python script?

2 posts in this topic

Hi to all.

My question is if is it possible read with Autoit a output value of python script and load it for example in a array.

My first idea is execute a python script and load the result in a file and then read whith Autoit whith FileReadToArray.

I don't know if this way is the best.
 
Thank's to all

 

Share this post


Link to post
Share on other sites



You could use Run to start the python script and grab any output written to the console using StdOutRead.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • KemyKo
      By KemyKo
      I recently discovered these: 
      https://pypi.python.org/pypi/PyAutoIt
      https://github.com/jacexh/pyautoit
      I guess any python developer knows what these are.
       
      The problem is that I`m on a 64bit version of Windows and i can`t use neither 
      pip install -U pyautoit nor 
      python setup.py install to install the package 
       
      Is there anyone who has the same problem like me?
      Suggest your suggestions 
      *(nice joke right there )*

      Problem solved -> Apparently when i run the setup.py file from github it worked.
       
    • vikashbitm2010
      By vikashbitm2010
      Hi all,
      I want to return string from autoit script to the python code.
      Autoit:
      Exit("22 FE 45") -> not working
      Exit(1) -> Working
      Exit(0) -> Working
      python:
      import os
      res=os.system(autoitmine.exe)
      print "res",res
      I got some hint of @ExitCode macro, but dont know how to use it to get the string in python variable 'res'.
      Please resolve this issue for me if anyone knows about this.
       
    • InunoTaishou
      By InunoTaishou
      Got this idea a long time ago to create a really neat project using a raspberry pi, camera, some custom python code, and a monitor I pulled from an old laptop. The idea is to create an interactive and informational display using the monitor and it will hang on my wall. Custom code will display the time, date, weather forecast, and current events. Has a temperature/humidity for the room (also shown on the display) and a motion censor. Censor will be enabled when I enter the pin for when I leave my room, and turned off when I come back and re-enter the pin. Once the censor is enabled (my security feature is enabled) it will activate the camera, taking a snapshot as soon as it's triggered, email me the screenshot, and then continue to snap pictures every second. Once the person has left my room, zips everything up and then emails me the zip file. Figured it was a good way to play with python, play with the raspberry pi, and make sure anyone coming to my room isn't doing anything sneaky (since I live in the dorms)
      Started the code today and had to figure out how to draw a string like _GDIPlus_GraphicsDrawStringEx. Because I wanted to define movable areas to render all of my text (so the position of the text is dynamic, and can be moved around and the position changed whenever I want to). Since pygame doesn't have anything like that, and it doesn't support multi-line text, let alone aligned text, I had to come up with how to allow multi line, then moved onto alignment, and make sure everything fit inside the defined area, not drawing any extra text that would "bleed" outside the rect
      Here's the progress of the text. The greetings text has the left alignment, top line alignment. Time and date have center and center, and fps actually has the whole screen as the rect but uses right alignment + bottom line alignment, making it show in the bottom right corner


      Source can be found on github for anyone interested
      This is way incomplete, probably gonna take months to get to the final product, but I predict I'll need to draw text in a defined area a lot.
    • ALIENQuake
      By ALIENQuake
      Hello everyone,
      Finally I decide to ask hard question about one of the project which I currently maintain:
      Big World Setup aka mod installer for infinity engine games like BG, IWD, PST etc
      Project page: https://bitbucket.org/BigWorldSetup/bigworldsetup/overview
      More screenshot: https://forums.beamdog.com/discussion/44476/tool-big-world-setup-bws-mod-manager-for-baldurs-gate-enhanced-edition-trilogy-for-windows/p1
      General Features
      downloading mods (please see remarks!) easy mod installation correct install order of mods/components handle mod and components conflicts and auto solve them easy backup creation/restoring ability to add you own mods Internal Features (every single feature which you see here is already working in autoit)
       
      It look as simple GUI application but it has quite complicated logic regarding "handle mod and components conflicts and auto solve them" - this is most important feature of the app.
      This app needs to be converted into multi-platform GUI application because Enhanced Editions of the game can be played on OSX and Linux also. But for the past 6 years, there wasn't a single gamer/developer who would try to convert this app using multi-platform language and GUI. 
      This is the moment when I'm asking for help:
      - Which language would suit the best for multi-platform GUI application?  c#,python,java or other?
      - Is there any general approach for such conversion? 
      - Does autoit community/developer have some experience with converting autoit GUI applications into multi-platform GUI app by using multi-platform language like c#,python,java
      - Is there someone who isn't scared by looking at the source code of the application and feature list to help me with converting or even begin with creating multi-platform GUI app template which will just simply run the same commandline for every system ? 
      If there is something else which you would know, pleas ask and I will try to answer my best.
       
    • nmontec
      By nmontec
      Dear All,
      I am having some trouble in automating a window. Everything is fine is I may use the couple WinActivate/WinWaitActive but it is not working if the window is minimized.
      I need to click a button and I tried the following:
      I declared in an object a reference like this:
      self.autoit=win32com.client.Dispatch('AutoItX3.Control') self.autoit.AutoItSetOption('WinTitleMatchMode',2) self.autoit.AutoItSetOption("WinDetectHiddenText", 1) And a t a certain point I press the Exit button
      self.autoit.ControlClick('Dome','','[CLASSNN:WindowsForms10.BUTTON.app.0.378734a15]') self.autoit.ControlClick('Dome','','[NAME:ButtonExit]') self.autoit.ControlClick('Dome','','[CLASS:WindowsForms10.BUTTON.app.0.378734a; INSTANCE:15]') Now, If the window is active and screen is not locked all is ok.But if window is minimized and/or screen is locked the command does not have any effect on the window. As far as I know controlclick should work also on these situations. Am I wrong?
      Thanks a lot for your help
      Nicola