Python script to run a linux command


from fabric import tasks
from fabric.api import run
from fabric.api import env
from import disconnect_all
import os
import platform
import csv
import subprocess

env.hosts = [


def pro():
global ch
global y
global n
#print m
res1= run(‘ifconfig’)

def main():
uts_dict = tasks.execute(pro)

if name == ‘main’:

When I run the above code in terminal it asks for password for both ip’s(,
After giving the password I get the output.
How can I run the the program so that it does not ask for password and I directly get the output in terminal?


Just a heads up - the content and discussions in this forum mostly revolve around Meteor, Apollo, and their surrounding ecosystem (javascript, mongo, react, angular, etc.). While someone in this forum might be able to help you out with a Python question, you might have better luck asking your question on a Python specific forum.

Unless of course this is somehow a Meteor related question?


Okay. Thanks hwillson