Jump to content
KemyKo

AUTOIT WITH PYHTON

Recommended Posts

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 :D

*(nice joke right there :shifty:)*


Problem solved -> Apparently when i run the setup.py file from github it worked.

 

Edited by KemyKo
Problem Solved

Share this post


Link to post
Share on other sites
TheDcoder

Just out of curiosity, what error did pip show?


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
KemyKo
3 hours ago, TheDcoder said:

Just out of curiosity, what error did pip show?

Pip showed the same error like here.

error.png

Edited by KemyKo
Incomplete

Share this post


Link to post
Share on other sites
TheDcoder

Oh, okay. Some python error that I cannot understand :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
JLogan3o13

If you google python windows error 193 you'll see a number of threads on the topic.

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
leb

Perhaps Python tried to run a dll compiled on a more recent version of C++.

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

    • Ascer
      By Ascer
      Hello mates.
      I would like to share simple but very important function required durning code many *au3 files.
      Such as function is used by a few scripts developers on forum but most of users waste a lot of time to make his functions/tool free from errors and bugs.
      How is working?
      This function do not check errors like Scite debugger. You can be able to make something like call exceptions in Python.
      Think about this and think when you ran some code, no error but also do nothing. 0 information and you have to jump into own or other script to find out reason.
      Function: Updated 2018-02-04, 08:47 (fixed AutoIt problem with dedection @ScriptName)
      ;============================================================================================================================================================== ; Function: Exception ([ $sInfo = "" [, $vReturnValue = Null [, $vExtended = @extended [, $iErrorNr = @error [, $iErrorLine = @ScriptLineNumber ]]]]]) ; ; Description: Call exceptions in different *au3 files located in this same Folder. ; ; Parameter(s): $sInfo - Information about exception in code, created by yourself. ; $vReturnValue - (Default=Null) Set value to return durning exception. ; $iErrorNr - (Default=@error) Set the error manually by adding a number. ; $vExtended - (Default=@extended) Set extended manually. ; $iErrorLine - Internal use do not change! ; ; Return Value(s): $vReturnValue, ; Additional: Output string in Scite Console about debug trace. ; ; Author (s): Who cares? ;============================================================================================================================================================== Func Exception($sInfo="", $vReturnValue = Null, $iErrorLine = @ScriptLineNumber, $iErrorNr = @error, $vExtended = @extended) Dim $aArray[0] Local $sScriptPath = @ScriptFullPath Local $sCurrentScriptLine = StringLower(FileReadLine($sScriptPath, $iErrorLine)) If Not StringInStr($sCurrentScriptLine, "exception") Then Local $aInclude = FileReadToArray($sScriptPath) For $sItem In $aInclude Local $sLowerLine = StringLower($sItem) If StringInStr($sLowerLine, "#include") Then Local $sIncludeName = StringTrimLeft($sItem, 8) Local $sConvertedName = "" Local $bAdd = False Local $aDelimeter = ["<", ">"] If StringInStr($sIncludeName , "'") Then $aDelimeter[0] = "'" $aDelimeter[1] = "'" ElseIf StringInStr($sIncludeName , '"') Then $aDelimeter[0] = '"' $aDelimeter[1] = '"' EndIf Local $aSplitInclude = StringSplit($sIncludeName, "") For $sSign In $aSplitInclude If $sSign = $aDelimeter[0] And Not $bAdd Then $bAdd = True ContinueLoop ElseIf $sSign = $aDelimeter[1] And $bAdd Then ReDim $aArray[UBound($aArray) + 1] $aArray[UBound($aArray) - 1] = $sConvertedName ExitLoop EndIf If $bAdd Then $sConvertedName &= $sSign Next EndIf Next EndIf If UBound($aArray) > 0 Then For $sName In $aArray Local $sPath = @ScriptDir & "\" & $sName If FileExists($sPath) Then $sCurrentScriptLine = StringLower(FileReadLine($sPath, $iErrorLine)) If StringInStr($sCurrentScriptLine, "exception") Then $sScriptPath = $sPath ExitLoop EndIf EndIf Next EndIf Local $aFile = FileReadToArray($sScriptPath) Local $sFunctionName, $sLine Local $bFound = False For $i = 0 To $iErrorLine - 1 If $bFound Or $iErrorLine <= 0 Then ExitLoop $sLine = StringReplace($aFile[$iErrorLine - $i], @TAB, "") If StringInStr(StringLower($sLine), "func ") Then Local $aSortLine = StringSplit($sLine, '') $sLine = "" For $h = 1 To $aSortLine[0] - 1 Local $sLowerSort = StringLower($aSortLine[$h]) If $sLowerSort = "(" Then $bFound = True ExitLoop ElseIf $sLowerSort <> @TAB And $sLowerSort <> " " Then If $sLowerSort = "f" Or $sLowerSort = "u" Or $sLowerSort = "n" Or $sLowerSort = "c" Then $sLine &= $aSortLine[$h] Else If Not StringInStr($sLine, "func") Then $sLine = "" ExitLoop Else $sLine &= $aSortLine[$h] EndIf EndIf EndIf Next EndIf Next If StringLeft(StringLower($sLine), 4) <> "func" Then $sLine = "" EndIf $sFunctionName = StringTrimLeft($sLine, 4) If StringLen($sFunctionName) < 1 Then $sFunctionName = "not recognized" Else $sFunctionName &= " ( ... )" EndIf If StringLen($sInfo) < 1 Then $sInfo = "nothing about" EndIf $vRet = $vReturnValue If $vRet = Null Then $vRet = "Null" ElseIf IsArray($vRet) Then $vRet = "an Array with " & UBound($vRet) & " items" ElseIf IsBinary($vRet) Then $vRet = "binary " & $vRet ElseIf IsBool($vRet) Then $vRet = "bool " & $vRet ElseIf IsDllStruct($vRet) Then $vRet = "dll struct " & $vRet ElseIf IsFloat($vRet) Then $vRet = "float " & $vRet ElseIf IsHWnd($vRet) Then $vRet = "hwnd " & $vRet ElseIf IsInt($vRet) Then $vRet = "int " & $vRet ElseIf IsKeyword($vRet) Then $vRet = "keyword " & $vRet ElseIf IsNumber($vRet) Then $vRet = "number " & $vRet ElseIf IsObj($vRet) Then $vRet = "object " & $vRet ElseIf IsPtr($vRet) Then $vRet = "ptr " & $vRet ElseIf IsString($vRet) Then If $vReturnValue = "" or StringReplace($vRet, " ", "") = "" Then $vRet = 'empty string ""' Else $vRet = 'string "' & $vRet & '"' EndIf EndIf Local $sStruct $sStruct &= "! Exception = {" & @CRLF $sStruct &= "!" & @CRLF $sStruct &= "!" & @TAB & '"date" = ' & @YEAR & "-" & @MON & "-" & @MDAY & ", " & @HOUR & ":" & @MIN & ":" & @SEC & ", " & @MSEC & "ms," & @CRLF $sStruct &= "!" & @TAB & '"path" = ' & $sScriptPath & "," & @CRLF $sStruct &= "!" & @TAB & '"line" = ' & $iErrorLine & "," & @CRLF $sStruct &= "!" & @TAB & '"func" = ' & $sFunctionName & "," & @CRLF $sStruct &= "!" & @TAB & '"retn" = ' & $vRet & "," & @CRLF $sStruct &= "!" & @TAB & '"exten" = ' & $vExtended & "," & @CRLF $sStruct &= "!" & @TAB & '"error" = ' & $iErrorNr & "," & @CRLF $sStruct &= "!" & @TAB & '"info" = ' & $sInfo $sStruct &= @CRLF $sStruct &= "!" & @CRLF $sStruct &= "! }" & @CRLF & @CRLF ConsoleWrite($sStruct) Return $vReturnValue EndFunc ;==> Exception  
      How to use? - Example 1
      Func Example() Local $sFile = FileOpen(@ScriptDir & "\example.py") If $sFile = -1 Then Return Exception("Failed to open 'example.py', File not exist!") EndIf ; continue working EndFunc Example() Example 1 Output in Scite console:

      Example 2
      Func Example2() Local $oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1.Fake") ; added .Fake to make object wrong. If Not IsObj($oHttp) Then Return Exception("Failed to create Object in variable $oHttp.", 2.2) EndIf ; continue working EndFunc Local $vRet = Example2() ConsoleWrite("$vRet = " & $vRet & @CRLF) Example 2 Output in Scite console:

    • n3wbie
      By n3wbie
      Hello m trying to learn python 
      m interested in knowing if there is koda like gui designer for python
      please also help me what all additional modules i require
      like ones which are famous
      i have already done with
      1.Scrapy
      2.Openpyxl
      3.twister
      4.selenium
      5.Requests
      6.pdfrw
       
    • breakbadsp
      By breakbadsp
      I want to run a python script from autoit. 
      I know we can do this with shellexecute or run , but this python script takes 3 cmd line arguments.
      How to pass them from autoit script?
      I tried many ways.
      Following solution also not working 
      e.g. 
      RunWait( 'fullpath\Python.exe Scriptpath\ReadLog.py  -f "file.log" -k "key" -e "errMsg" ') Found solution:
      RunWait( 'fullpath\Python.exe ReadLog.py -f "file.log" -k "key" -e "errMsg" ', 'Working_directory_path')  
      PFB description:
      https://stackoverflow.com/questions/45757834/how-to-pass-command-line-arguments-to-a-python-script-anyscript-while-executin
       
    • 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.
×