I was trying to display the title in prettyTable but not sure what is wrong here -
#!/usr/bin/python3
from prettytable import PrettyTable
hostname = "abc.com"
table = PrettyTable()
table.title = hostname
table.field_names = ['hostname', 'process']
table.add_row(['abc.com', '31324'])
table.add_row(['abc.com', '42230'])
print(table)
Output -
+----------+---------+
| hostname | process |
+----------+---------+
| abc.com | 31324 |
| abc.com | 42230 |
+----------+---------+
Expected Output -
+----------+---------+
| abc.com |
+----------+---------+
| hostname | process |
+----------+---------+
| abc.com | 31324 |
| abc.com | 42230 |
+----------+---------+