Skip to content

Instantly share code, notes, and snippets.

@anaved anaved/
Last active Aug 2, 2017

What would you like to do?
Simple partial example
from functools import partial
def power(number, order):
"""This is a power function"""
return number ** order
square = partial( power, order = 2)
cube = partial( power, order = 3)
if __name__ == "__main__":
print square(2)
print cube(2)
def ssh_execute(host,username,password,command):
connection = ssh_connection(host,port,username,password)
return connection.execute(command)
prod_server = partial(ssh_execute, 'prod_host','prod_username', 'prod_pass' )
dev_server = partial(ssh_execute, 'dev_host','dev_username', 'dev_pass' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.