Recommend me a scripting language

Any other tech-related topics
Post Reply
Message
Author
User avatar
m^(2)
Posts: 890
Joined: Sat Mar 31, 2007 2:38 am
Location: Kce,PL
Contact:

Recommend me a scripting language

#1 Post by m^(2) »

Currently I'm using MS batch scripts for almost everything and AutoHotKey when I need something more advanced (i.e. maths ;) ).
However, I'm dealing more and more with Unicode file names and these languages don't support them. Using short names sometimes helps, but sometimes it doesn't and it's not always feasible anyway.

So I'm looking for a language:
-with Unicode support
-portable
-standalone, no need to run apache in background etc.

TIA for your help.

infimum
Posts: 231
Joined: Sun Mar 02, 2008 1:00 am

Re: Recommend me a scripting language

#2 Post by infimum »

AutoIt is a natural candidate if you used AutoHotkey. AutoHotkey really needs to support unicode soon if it want to stay a viable choice.

User avatar
m^(2)
Posts: 890
Joined: Sat Mar 31, 2007 2:38 am
Location: Kce,PL
Contact:

Re: Recommend me a scripting language

#3 Post by m^(2) »

infimum wrote:AutoIt is a natural candidate if you used AutoHotkey. AutoHotkey really needs to support unicode soon if it want to stay a viable choice.
Great answer, thanks :)

ADDED: Though some higher level language would be better ;)

fpelletier
Posts: 21
Joined: Thu Jun 19, 2008 8:33 am
Location: Philadelphia area

Re: Recommend me a scripting language

#4 Post by fpelletier »

AutoIt will do what you're asking for.

If you decide to kick it up to the next level, Python is the ultimate portable solution. Furthermore, the Movable Python implementation is built by Michael Foord such that the development environment is kept on the jump drive too. Python has no real boundaries of any kind and is easy to learn. You may want to scope it out at http://www.voidspace.org.uk/python/movpy/ It comes with a great IDE. Once you make the decision to learn it, it is amazing how powerful and versatile it is. It integrates with AutoIt too. It is a brilliantly written language. If you're not familiar with it, it is known as a scripting language because of how tight your code is and that it is natively interpreted, but it can be compiled if you like. It is a full, object oriented programming facility.

User avatar
m^(2)
Posts: 890
Joined: Sat Mar 31, 2007 2:38 am
Location: Kce,PL
Contact:

Re: Recommend me a scripting language

#5 Post by m^(2) »

fpelletier wrote:AutoIt will do what you're asking for.

If you decide to kick it up to the next level, Python is the ultimate portable solution. Furthermore, the Movable Python implementation is built by Michael Foord such that the development environment is kept on the jump drive too. Python has no real boundaries of any kind and is easy to learn. You may want to scope it out at http://www.voidspace.org.uk/python/movpy/ It comes with a great IDE. Once you make the decision to learn it, it is amazing how powerful and versatile it is. It integrates with AutoIt too. It is a brilliantly written language. If you're not familiar with it, it is known as a scripting language because of how tight your code is and that it is natively interpreted, but it can be compiled if you like. It is a full, object oriented programming facility.
I wanted to learn Python, because I read a lot of good things about it. But I lacked motivation.
Now I downloaded movpy, managed to install and run it, learning language starts tomorrow. :)
BTW IDE sucks IMO, I'll use my text editor. ;)

-.-
Posts: 325
Joined: Mon Oct 06, 2008 4:32 pm

Re: Recommend me a scripting language

#6 Post by -.- »

i dont know how to use these but i've heard good things about ruby http://www.ruby-lang.org/ and google's Go http://golang.org/

User avatar
m^(2)
Posts: 890
Joined: Sat Mar 31, 2007 2:38 am
Location: Kce,PL
Contact:

Re: Recommend me a scripting language

#7 Post by m^(2) »

-.- wrote:i dont know how to use these but i've heard good things about ruby http://www.ruby-lang.org/ and google's Go http://golang.org/
Thank you too.
I'll see Python and if it doesn't work the way I want, I'll try Ruby too.
Google is a no-go for me. ;)

fpelletier
Posts: 21
Joined: Thu Jun 19, 2008 8:33 am
Location: Philadelphia area

Re: Recommend me a scripting language

#8 Post by fpelletier »

m^(2), did you try the Stani editor (SPE)? Actually, movepy comes with three editors, SPE, Idle, and Pythonwin. Idle is a command line editor for lack of a better description. Pythonwin and SPE are both graphical IDEs. Pythonwin is a text editor with a few conveniences. SPE is the most robust IDE that I have found that is not a commercial product. It is geared exclusively for Python coding. It never occured to me to offer Movepy up as a candidate for this website, but it is completely self-contained and portable.

Try this, run movepyw.exe--this will run a launcher. From the menubar, choose configure-> Quick Launch. Fill out the dialog box for button 1 as, Name: SPE IDE, File: lib/_spe/SPE.pyw, make sure "b" is checked, and Console is On, and then OK. Now click on button 1. SPE should launch after a momentary black window. Until you set up Python, you should do it this way as it was written in python and runs through it.

Hey, one other thought, have you researched PowerBatch? It is the new batch language from Microsoft. It too is fully capable now. It has a greater learning curve, but it is an option for those with Vista or Windows 7 as it comes native with those O/Ss. It is also object oriented now and .NET aware so it understands the namespace architecture. Consider the great tools that Nir Soffer creates. I believe he is writing with .NET C#, LINQ and WMI. PowerBatch and Python can make use of LINQ and WMI too.

Last, if you try Python and want to dabble in it, Microsoft now supports Python, as much as it resisted for so long, by creating a version called IronPython which now uses the CLR and a new DLR (dynamic language runtime). Microsoft even has provided a free editor for developing in IronPython. I throw these out there so you are aware of them and can research them in your own time.

User avatar
m^(2)
Posts: 890
Joined: Sat Mar 31, 2007 2:38 am
Location: Kce,PL
Contact:

Re: Recommend me a scripting language

#9 Post by m^(2) »

fpelletier wrote:m^(2), did you try the Stani editor (SPE)? Actually, movepy comes with three editors, SPE, Idle, and Pythonwin. Idle is a command line editor for lack of a better description. Pythonwin and SPE are both graphical IDEs. Pythonwin is a text editor with a few conveniences. SPE is the most robust IDE that I have found that is not a commercial product. It is geared exclusively for Python coding. It never occured to me to offer Movepy up as a candidate for this website, but it is completely self-contained and portable.

Try this, run movepyw.exe--this will run a launcher. From the menubar, choose configure-> Quick Launch. Fill out the dialog box for button 1 as, Name: SPE IDE, File: lib/_spe/SPE.pyw, make sure "b" is checked, and Console is On, and then OK. Now click on button 1. SPE should launch after a momentary black window. Until you set up Python, you should do it this way as it was written in python and runs through it.
I already have a batch that starts movepy(w) with IDE, w/out showing the dialog (which I see no use for)...though I don't think I'll be using it anyway, since Programmer's Notepad works very well.
I just went to try SPE, but I already went through size optimizations and wxPython is out, I won't bother since I already have a good solution. :)
fpelletier wrote:Hey, one other thought, have you researched PowerBatch? It is the new batch language from Microsoft. It too is fully capable now. It has a greater learning curve, but it is an option for those with Vista or Windows 7 as it comes native with those O/Ss. It is also object oriented now and .NET aware so it understands the namespace architecture. Consider the great tools that Nir Soffer creates. I believe he is writing with .NET C#, LINQ and WMI. PowerBatch and Python can make use of LINQ and WMI too.

Last, if you try Python and want to dabble in it, Microsoft now supports Python, as much as it resisted for so long, by creating a version called IronPython which now uses the CLR and a new DLR (dynamic language runtime). Microsoft even has provided a free editor for developing in IronPython. I throw these out there so you are aware of them and can research them in your own time.
I've been thinking about PowerBatch, but I really, really dislike .NET. Since there are alternatives, I'm not going to use it anytime soon.

Thanks for your input!

User avatar
m^(2)
Posts: 890
Joined: Sat Mar 31, 2007 2:38 am
Location: Kce,PL
Contact:

Re: Recommend me a scripting language

#10 Post by m^(2) »

I'm currently rewriting a script to Python...and have a major issue.
It does a lot of file work...and a lot of this work fails.
On every failed operation Python throws an exception, so my code looks almost like:

Code: Select all

try:
    call os function
except:
    pass
try:
    call os function
except:
    pass
(...)
I could rewrite it to something like:

Code: Select all

if something:
    call os function
if something:
    call os function
But it's still no joy, cleaner, but may crash when something unexpected happens, not to say that it takes more work.

Can't I just tell Python to ignore the exceptions and proceed?

EDIT:
One more way, I'm using it for now:

Code: Select all

def noE(x):
    try:
        x
    except:
        pass
Still no good, but better than the ones before.

fpelletier
Posts: 21
Joined: Thu Jun 19, 2008 8:33 am
Location: Philadelphia area

Re: Recommend me a scripting language

#11 Post by fpelletier »

m^(2),
Given this scenario, it appears that you are on the right track. I don't see a more elegant solution.

User avatar
m^(2)
Posts: 890
Joined: Sat Mar 31, 2007 2:38 am
Location: Kce,PL
Contact:

Re: Recommend me a scripting language

#12 Post by m^(2) »

At 3AM noE seemed to work, but now it doesn't.
I left it with those try-except blocks...

Anyway, I'm done with porting my first script. It grew from 4.2 to 5.2 KB in this transition, mostly because of exception handling, more complicated piping and more white spaces ;)...so overall about the same as batch.
I have to say that for now I'm somewhat disappointed with Python...I expected it to be more productive with what I'm doing and standard library is extremely messy.
I'll continue to learn it though, it should be better with bigger things.

Post Reply