You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with open("/home/iosdev747/Desktop/Linus/Linus/output.data", "w+") as outfile, open("/home/iosdev747/Desktop/Linus/Linus/error.data", "w+") as errfile:
with open("/home/iosdev747/Desktop/Linus/Linus/output.data", "r+") as outfile, open("/home/iosdev747/Desktop/Linus/Linus/error.data", "r+") as errfile:
if errfile.read():
return "Error occurred"
return outfile.read()
'''
It takes sudo passoword using environment variable "password"
'''
def sudo_execute_command(parameter):
with open("/home/iosdev747/Desktop/Linus/Linus/output.data", "w+") as outfile, open("/home/iosdev747/Desktop/Linus/Linus/error.data", "w+") as errfile:
p = subprocess.Popen('sudo -S' + parameter['command'], shell=True, stdout=outfile, stderr=errfile)
with open("/home/iosdev747/Desktop/Linus/Linus/output.data", "r+") as outfile, open("/home/iosdev747/Desktop/Linus/Linus/error.data", "r+") as errfile: