–
try:
memory_usage_percent_data = (1 - int(free_memory) / int(total_memory)) * 100
memory_usage_percent='{:.3f}'.format(memory_usage_percent_data)
return str(memory_usage_percent)+'%'
except ZeroDivisionError:
print("Error: Division by zero is not allowed.不允许除以零。")
return None # 或者可以设置为某个特定的错误代码或消息
else:
pass
finally:
pass
–
发表回复