Python Scripting

English support forum

Moderators: Hacker, petermad, Stefan2, white

billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Python Scripting

Post by *billiebub »

Python lovers, can we please have a Python scripting plugin(s) to execute Python scripts? I don't think it should be that hard to implement considering the fact that the Python script engine is included in so many software products. There are script WFX plugins such as VBScript, JScript but they're not as feature-rich as Python.
Last edited by billiebub on 2012-09-06, 23:24 UTC, edited 2 times in total.
billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Post by *billiebub »

I guess it's a Delphi world then. Everything is Delphi. The interpreted programming options are so limited and this also limits the quantity and quality of functionality.

Can you think of the kind of plugins that can be written using Python by leveraging it's powerful API? Anyone then could come up with plugins. Delphi vs Python...let's not go there. Python is so much easier to learn, extend and it's widely used. There are tons of libraries that are written in Python. Interpreted vs compiled.

Mr. Sigler, haven't you ever thought of including a scripting language to extend the functionality of TC besides compiled plugins?

Please consider such a powerful add-on to TC.
ThomasMuders
Junior Member
Junior Member
Posts: 5
Joined: 2008-08-11, 14:14 UTC

Post by *ThomasMuders »

Actually, there is a Pascal Script engine for Delphi, which is not bad.

http://www.remobjects.com/ps.aspx

I have used it, because it's included in InnoSetup.
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

billiebub wrote:Mr. Sigler, haven't you ever thought of including a scripting language to extend the functionality of TC besides compiled plugins?
I wonder whether Mr. Sigler will respond to your suggestion. :wink:
billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Post by *billiebub »

I've researched the Pascal Scripting Engine from remobjects and some people have decided to fork their own because this is what they say about it:
This project started because Pascal Script is pretty slow and it didn't function very well on platforms other than Windows(x86).
To be honest I was not surprised to read the above comment. After all, Pascal is not a scripting language. Just imagine trying to script something like C++, how limited are you going to be?

TC Plugin author who wrote the scriptWFX which executes VBScript was a success because he relied on the VBScript scripting engine, a mature engine that's been used since the beginning of Windows. The only issue I see with scriptWFX is the limitation of VBScript's in terms of:

1. limited out of the box collection of modules
2. not platform independent. Think of modules that were written to work under Linux/Solaris/Unix. They can also work under Windows (most of them) if Python were to be used.


Python already provides the scripting engine to be used as part of applications to extend their functionality. The question is, why bother reinventing the wheel when it already exists?

Forget about trying to fork a scritping language out of a compiled one and stick to using a mature, well-known one. Very simple.
User avatar
TLis
Member
Member
Posts: 111
Joined: 2004-06-02, 16:48 UTC
Location: Szczecin, Poland

Post by *TLis »

I am curious, what the advantage could be over just installing Python and setting up buttons to call the interpreter with the given script? Usual placeholders can be used to transfer the arguments to the script.
billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Post by *billiebub »

Glad you asked. Plugin support will give you the enhanced look and feel that TC offers all within the panels. I can think of many examples but to name a few:

1. Content plugins. Quick easy to setup content plugins that would parse even the most complicated files, for example packet files from tcpdump if you know what I'm talking about.

2. File System plugins. In less than 30 lines of code, you can write a malware scanner that would scan each file as it loads against a well known malware database. These scanners specialize in malware detection where most Anti-viruses fail.

3. File system plugins. Metadata extraction of various files that can be extended. For example, in less than 20 lines of python code you can write a PDF metadata extractor.

4. Lister plugins. Imagine a doc file contains macro and you're afraid to open it. You can write a listen plugin in python and use the famous OleFileIO module to check whether the doc file has embedded macros in it. You can even extend the plugin to show you the macro code before opening it all in less than 20 lines of code.


I can give you another 20 if you want examples but 4 should be sufficient in my opinion.

The problem here is that there is limitation with what can get produced in terms of plugins. To write a plugin for any of the mentioned bullets above, it really takes time, effort, and lots of testing when they get written in a compiled non-managed languages such as Delphi, C, and C++. After all, many plugins are free and authors tend to be skeptical when it comes to writing plugins of these wide requirements.

Just to let you know, the code for the above bullets exists and in less than 30 lines of code. Tons and tons of modules exist for Python. Just think the millions of Python developers that could come up with an extraordinary number of plugins if there was a good support for it.
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

billiebub wrote:Just to let you know, the code for the above bullets exists and in less than 30 lines of code.
Now and again I have the impression that Python is a very promising scripting language that I should get to know better. Please show the uninitiated the existing 30-liners for any two of the examples above like this:

Code: Select all

01
02
..
30

Code: Select all

01
02
..
30
billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Post by *billiebub »

Is this something that can be considered one day in the future?
billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Post by *billiebub »

Ok forget about Python. Any form of scripting will be added in the future to total commander?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50930
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, currently I do not plan any scripting limited to just Total Commander. Windows is a multi-tasking environment. Therefore I think that it doesn't make sense to have a separate scripting tool in each program. Better use a tool like AutoHotkey.
Author of Total Commander
https://www.ghisler.com
billiebub
Member
Member
Posts: 187
Joined: 2011-04-12, 19:49 UTC

Post by *billiebub »

I think you're missing the point. Plugins that can be scripted rather than compiled will add the potential for having more variety of plugins. This has nothing to do with Windows being multi-tasked and no it does not make sense to script all programs but Total Commander provides plugin capabilities and the simple thing to ask is, would it make sense to script plugins or have the choice to rather than create native ones all the time?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7025
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

billiebub wrote:I think you're missing the point. Plugins that can be scripted rather than compiled will add the potential for having more variety of plugins. This has nothing to do with Windows being multi-tasked and no it does not make sense to script all programs but Total Commander provides plugin capabilities and the simple thing to ask is, would it make sense to script plugins or have the choice to rather than create native ones all the time?
You are missing the point.
Using Autohotkey is not having any plugin to be scipted
but just a way to script anything in any program.
No plugin is needed in that case.
User avatar
nsp
Power Member
Power Member
Posts: 1956
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

billiebub wrote:I think you're missing the point. Plugins that can be scripted rather than compiled will add the potential for having more variety of plugins. This has nothing to do with Windows being multi-tasked and no it does not make sense to script all programs but Total Commander provides plugin capabilities and the simple thing to ask is, would it make sense to script plugins or have the choice to rather than create native ones all the time?
You are missing the point that you can already interact with TC in python but C. Ghisler do not want to provide any automation API. And from many discussion in the past, it seems that C. Ghisler want to keep integrity of TC and not opening the box and do not support too much automation.

For now:
You can use Windows message to send any TC command if you need parameters, WM_COPYDATA is also available for CD, EM ....

For a very limited set of message you can also get some information from TC with copydata "callback".
You can also get a lot of info from logs and ini files.

Interacting with user interface is more difficult if you want to cover 64bit version.

Autohottkey seems to be the most popular automation tool in this forum. But you are free to use your preferred programming language to do what is currently allowed.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

The topic wasn't about automation but scripting support for plugins.
Post Reply