Jump to content

AutoIt vs Python


Roshith
 Share

Recommended Posts

Hi,

I never scripted in Python, but pretty comfortable with AutoIt. But I understand that python works on any platform and AutoIt on Windows.

But in Windows platform, is Python any better than AutoIt?

in other words

Are there any things which can be done only by Python and not by AutoIt on Windows or Vice versa

Rgds

Roshith

Link to comment
Share on other sites

Python supports native threads, in AutoIt all threads have to be created in a dll or with inline-asm.

Apart from that you can do about anything Pothon supports in AutoIt and vice versa. Only the difficulty level for different tasks varies.

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

That means if you wanna do threads in autoit, you either have to write the code in another language or write raw machine code. Python is an object oriented language, while autoit is a procedural language. They are both interpreted languages, but python is compiled to bytecode before interpretation, that gives much greater speed, in some cases comparable to compiled languages.

Python has a huge library for nearly everything, while autoit is heavily aimed towards automation. Hence, that is easier in autoit, while more generic programming probably fits python better.

Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

Link to comment
Share on other sites

They are both interpreted languages, but python is compiled to bytecode before interpretation, that gives much greater speed, in some cases comparable to compiled languages.

I'm not sure if this is true.

Autoit at time of compilation converts script to bytecode too. So what's the diference?

Link to comment
Share on other sites

  • Moderators

Zedna,

Autoit at time of compilation converts script to bytecode too

I believe the actual script text, less comments and blank lines, is compressed (and so encrypted slightly) and then appended to the interpreter stub, which decompresses and reads the appended script line-by-line at runtime. So there is no bytecode conversion in the normally accepted sense of "compilation". :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

As someone who uses both:

AutoIt is better for GUIs. It doesn't have to worry about cross-platform stuff so it's easier to use. Python is better at maths. The python language can be extended a lot easier than AutoIts... By that I mean you can overload operators with custom types.

There are automation frameworks for python. I never bothered as AutoIt does everything I need with automation.

Link to comment
Share on other sites

I'm not sure if this is true.

Autoit at time of compilation converts script to bytecode too. So what's the diference?

Nope, it doesn't. Bytecode in this context means that variables, names, expressions and statements etc. is reduced (reinterpreted and compiled) to an much easier language to interpret, with index and numbers as variable names and a set of instructions, for example. It looks something like assembly. This means, that compilation of a script takes a little longer, but might increase execution speed a hundred times.

Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

Link to comment
Share on other sites

Nope, it doesn't. Bytecode in this context means that variables, names, expressions and statements etc. is reduced (reinterpreted and compiled) to an much easier language to interpret, with index and numbers as variable names and a set of instructions, for example. It looks something like assembly. This means, that compilation of a script takes a little longer, but might increase execution speed a hundred times.

Until Autoit 3.2.6 Aut2Exe just merged runtime bin + original script (with bundled includes and removed comments).

But Since 3.2.6 version Aut2Exe creates "bytecode" - binary preprocessed script.

As you can see from changelog Jon did subsequent speed improvements so this new bytecode compilated code runs 54% to 64% faster.

I'm not expert in this area so please no flame here I just point that Autoit has some kind of bytecode compilation too.

I didn't know that there are such diferent kinds of bytecode compilation.

3.2.6.0 (25th August, 2007) (Release)

- Changed: AutoIt .a3x and compiled script format. Exe2Aut will only decompile 3.2.5.1

and earlier files. No ExeAut utility is supplied for ongoing versions.

- Changed: General performance improvements (currently around 30-40% over 3.2.4.9)

3.2.8.0 (8th September, 2007) (Release)

- Changed: General speed improvements (currently up to 24% in some cases compared to 3.2.6.0).

Link to comment
Share on other sites

You did your maths wrong Zedna Posted Image , that 24% is on top of the 30-40%, so it's actually 61.2 - 73.6% faster compared to 3.2.4.9.

That's true. Also, Mat you did your grammar wrong. :D

Any way python is better for making small games (example of a game I've worked on and helped with) in my opinion and small scripts however, AutoIt is by far the best and fastest Automation for Windows AND Linux (I finally got AutoIt to pass calls to Linux via a heck of a lot of Jury-rigging with shell scripts. o/)

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

  • 2 months later...

These days i'm starting learning Python, and the thing that (i think) really lakes in Python, is the ability to compile a script to an .exe with only one key!

In python, i tried to compil using py2exe and another tool (don't remeber it's name) and i didn't make it cause i used PyOpenGL.

So, i think the compilation is easier in AutoIt, and i really like this.

Edited by matwachich
Link to comment
Share on other sites

  • 5 years later...

I will necro this post just to voice my opinion on the topic after dealing with Python for a few hrs.

2 HUGE problems i find with python is that
#1 You create function before you call it.
In other words: (i am using autoit example of function coding)
 

_MuFunc() ;call the function
Func _MyFunc()
EndFunc

will not work. You have to put _MyFunc() AFTER EndFunc

#2 Compiling py files into EXE is problematic.
If you manage to compile it to EXE, you still have a problem where allot of files get included with your script.

Simple MessageBox.py converted to  Windows executable

import tkinter
from tkinter import messagebox

messagebox.showinfo("Title", "a Tk MessageBox")

will result in  923 files, 31 folders or 15.6mb of total in size with one MessageBox.exe file that will not work outside of those files/folders.

VS autoit code
 

MsgBox (0,'Title','a Tk MessageBox')

will result 1 executable file 800kbs and no folders or other files. And it will run with no problems.

 

The day i discovered this (to that is) i said to my self. Why the hell do i want to learn Python if its like that ?
I am more then positive that even if you are OK with all those 900+ files floating around, i doubt you would be ok with the fact that those scripts may not work on every computer you put it in.

 

I guess i am going back to C++ learning. Dont want to waste my time in py scripting.

Link to comment
Share on other sites

  • Developers
41 minutes ago, tonycst said:

just to voice my opinion on the topic after dealing with Python for a few hrs.

mmm... a few hours?  

 

I honestly don't think we should even try to compare these as the serve different purposes..   so let's keep this thread rested.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...