GithubHelp home page GithubHelp logo

telepythy's Introduction

telepythy

Remote Python Runner

This is an experimental library to make it easy to run python functions on remote machines you have ssh access to. This is cool since you don't have to resort to using shell functions to do your remote dirty work.

The intent of this library is to make interacting with remote systems easy and with low mental overhead. You are just running a function in the "context" of a remote machine. Nothing needs to be on the remote machine except for python (and any libraries you intend to use).

After you create a Remote object, you can use the run method to pass a function you want to run on the remote machine. The method can take arguments and return arguments as normal. Since telepythy uses pickle to marshal the arguments and return values, they must be picklable objects.

#Example:

from telepythy import Remote

def do_remote_thing(dir='/'):
    import os
    print('I am remote!')
    return os.listdir(dir)

s = Remote('localhost')

try:
    dir_list = s.run(
        do_remote_thing,
        dir="/usr"
    )
except Exception as e:
    print('I even handle remote exceptions! %s'%e)

for dir in dir_list:
    print(dir)

#Install

sudo pip install git+https://github.com/seiferteric/telepythy.git

telepythy's People

Contributors

seiferteric avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.