Recommended Scripting Languages
Thanks guys, I started playing with Python a little bit today. Worked through a bunch of "Learn Python the Hard way" but then got sort of bored with it so I started trying to do stuff. Downloaded the image module PIL and am fooling around with that. One basic thing that I don't get is how do I run scripts from the Python prompt? meaning if I have a script that I can run like "python dump_img.py "MyImage.png" from PowerShell, how do I do the same thing from the Python interactive mode?
One generally doesn't run scripts from within the interactive prompt (although it is possible). Rather you tend to run scripts directly from the shell (i.e. feed python the filename as a parameter).
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
I've done a decent amount of powershell scripting. It's not true about the license fee. You can use it on other computers. By combining powershell scripts and VMWare's vSphere SDK, I am able to deploy an entire network infrastructure with two mouse clicks (domain controller, sql server, exchange, sharepoint, etc). If you're looking for a scripting language to support your job as a sys admin, powershell is the way to go. It's got a bit of a learning curve to it, but it's not impossible for scripting newbies to pick up.
How do you go about doing this? From the help, windows has support for scripts disabled by default, I tried to change it to allow all scripts, but it wouldnt change (i guess you need to log in as the admin account?).
I got frustrated and learned python instead
Gavin Coates
[size="1"]IT Engineer / Web Developer / Aviation Consultant
[size="1"][ Taxiway Alpha ] [ Personal Home Page ]
[size="1"]IT Engineer / Web Developer / Aviation Consultant
[size="1"][ Taxiway Alpha ] [ Personal Home Page ]
[quote name='slayemin' timestamp='1329234323' post='4912995']
I've done a decent amount of powershell scripting. It's not true about the license fee. You can use it on other computers. By combining powershell scripts and VMWare's vSphere SDK, I am able to deploy an entire network infrastructure with two mouse clicks (domain controller, sql server, exchange, sharepoint, etc). If you're looking for a scripting language to support your job as a sys admin, powershell is the way to go. It's got a bit of a learning curve to it, but it's not impossible for scripting newbies to pick up.
How do you go about doing this? From the help, windows has support for scripts disabled by default, I tried to change it to allow all scripts, but it wouldnt change (i guess you need to log in as the admin account?).
I got frustrated and learned python instead
[/quote]
If you look closely at the error message, there's probably a message about the execution policy. In the powershell command prompt, type in "get-executionpolicy" and make sure that the result is "RemoteSigned". This will let you run powershell scripts. I had to do a bit of google-fu to find the right registry values to change. Usually though, you want to make sure that you're using an admin account to run scripts. There is a "get-credential" cmdlet you can use in your script to prompt the user to give admin credentials for running admin processes. If you do decide to start using powershell, the two commands you'll find most useful for learning are: "get-command" and "get-help".
Powershell scripting is a pretty good skill to have in your toolbelt if you're a sys admin on an enterprise windows network. A lot of the MS software suites have powershell plugins so that you can write scripts to automate your admin tasks. VMWare (and maybe other third party software) has added support for powershell, so there's a good chance that it'll catch on with other vendors (thus making it a somewhat worthwhile skill to maintain).
Eric Nevala
Indie Developer | Spellbound | Dev blog | Twitter | Unreal Engine 4
Thanks guys, I started playing with Python a little bit today. Worked through a bunch of "Learn Python the Hard way" but then got sort of bored with it so I started trying to do stuff. Downloaded the image module PIL and am fooling around with that. One basic thing that I don't get is how do I run scripts from the Python prompt? meaning if I have a script that I can run like "python dump_img.py "MyImage.png" from PowerShell, how do I do the same thing from the Python interactive mode?
If you are working on windows, download pyscripter. By far the best python editor imo (coming from someone who tried every last one of them), and free as in beer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement