Roshith Posted December 5, 2011 Posted December 5, 2011 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
ProgAndy Posted December 5, 2011 Posted December 5, 2011 (edited) 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 December 5, 2011 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
Roshith Posted December 5, 2011 Author Posted December 5, 2011 Thanks for your quick reply.. Can you please explain me "in AutoIt all threads have to be created in a dll or with inline-asm" When do we use this? Can we create and export dll in AutoIt?
Shaggi Posted December 5, 2011 Posted December 5, 2011 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
Roshith Posted December 5, 2011 Author Posted December 5, 2011 Thanks Shaggi.. That is a good piece of knowledge
Zedna Posted December 5, 2011 Posted December 5, 2011 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? Resources UDF ResourcesEx UDF AutoIt Forum Search
Moderators Melba23 Posted December 6, 2011 Moderators Posted December 6, 2011 Zedna,Autoit at time of compilation converts script to bytecode tooI 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". M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Mat Posted December 6, 2011 Posted December 6, 2011 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. AutoIt Project Listing
Shaggi Posted December 6, 2011 Posted December 6, 2011 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
Zedna Posted December 6, 2011 Posted December 6, 2011 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.1and 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). Resources UDF ResourcesEx UDF AutoIt Forum Search
Mat Posted December 6, 2011 Posted December 6, 2011 You did your maths wrong Zedna , that 24% is on top of the 30-40%, so it's actually 61.2 - 73.6% faster compared to 3.2.4.9. AutoIt Project Listing
rcmaehl Posted December 6, 2011 Posted December 6, 2011 (edited) You did your maths wrong Zedna , 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. 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 December 6, 2011 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 WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF
matwachich Posted February 20, 2012 Posted February 20, 2012 (edited) 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 February 20, 2012 by matwachich
tonycst Posted February 3, 2018 Posted February 3, 2018 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.
Developers Jos Posted February 3, 2018 Developers Posted February 3, 2018 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.
Recommended Posts