hello i have made a python script that tells me my usage of my disk on my nas over ssh but everytime i run the program i get this.
size b'442G' used b' 401M' available b'419G'
i want to get rid of the b and the quotes around the 422G and the others.
here is my code
import sys, paramiko
import os
import time
username = "alex"
hostname = "192.168.1.91"
password = "alex"
command = "df /dev/sda3 -h"
port = 22
client = paramiko.SSHClient()
def updateTimeMenu():
time_menu.delete(0, "end")
time_menu.add_command(label=time.ctime())
def ssh():
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.WarningPolicy())
client.connect(hostname, port=port, username=username, password=password)
menu()
def menu():
stdin, stdout, stderr = client.exec_command(command)
output = stdout.read()
print("Size", output[65:69], ", Used", output[70:75], ", Available", output[77:81]) #should output hdd info (size, used, avalable)
time.sleep(4)
ssh()
ssh()