#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2016
    Posts
    1
    Rep Power
    0

    Just starting out with Python


    Hi,

    Python is brand new to me, I've been working with PowerShell for a while and want to add Python to my scripting skill set.

    I don't really understand how to use Python to manage remote machines etc. I have a Python Script that changes my IP address, it's really cool but how do use against a remote machine???

    Do i need to install Python on the remote machines and then the modules etc and then invoke the command somehow?

    Any help would be great

    Thanks

    TommyQ
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,782
    Rep Power
    4301
    Depends on what you want the script to do. For instance, I wrote a script in python that I use to manage linux machines remotely. What my program does is connect to each of the machines in turn using ssh and then runs a bunch of commands that I specify. In most cases, the commands that I run remotely don't need python, so it doesn't have to be installed on the remote machines at all. On the rare occasion, I may need to run something complicated on these remote machines, in which case I put the python script in a location that is shared by all the remote machines and then trigger my master python program to connect to each machine and fire off the python program on the shared mount on each one of the machines. As most linux distros install python by default already, I don't need to install python on those machines separately.

    If your machines are windows, you may be able to use the DCOM interface to run stuff remotely (DCOM is somewhat language agnostic, I did something like this using DCOM interfaces with both VB and Delphi something like 17 years ago!). Or you can use the WMI module that someone wrote that wraps DCOM and WMI interfaces in a python module. See Contents for details. In many use cases (such as setting IP addresses remotely), you don't need to install python on the remote boxes, you can manage it via WMI.
    Last edited by Scorpions4ever; October 26th, 2016 at 09:40 PM.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Posts
    1
    Rep Power
    0
    Well, that's good to hear that you're trying out python. Python is a very simple and flexible programming. With Python, you can do powerful stuffs with less coding and hassle.

    Python is also very easy to set up, learn and use on any OS you'd like to use. You'll need to install Python on your machine, before you can start using it.

    You should try reading this article on SIITGo here, which explains and shows how you can install and use Python on any platform you'd like to use.

IMN logo majestic logo threadwatch logo seochat tools logo