File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 11
11
from rich .table import Table
12
12
13
13
import cmd2
14
+ from cmd2 .colors import Color
14
15
15
16
CITY_HEADERS = ['Flag' , 'City' , 'Country' , '2025 Population' ]
16
17
CITY_DATA = [
@@ -102,16 +103,16 @@ def do_countries(self, _: cmd2.Statement) -> None:
102
103
table .add_row (* str_row )
103
104
104
105
# Make Population column blue
105
- table .columns [2 ].header_style = "bold blue"
106
- table .columns [2 ].style = "blue"
106
+ table .columns [2 ].header_style = Color . BRIGHT_BLUE
107
+ table .columns [2 ].style = Color . BLUE
107
108
108
109
# Make Density column red
109
- table .columns [4 ].header_style = "bold red"
110
- table .columns [4 ].style = "red"
110
+ table .columns [4 ].header_style = Color . BRIGHT_RED
111
+ table .columns [4 ].style = Color . RED
111
112
112
113
# Make GDB per capita column green
113
- table .columns [6 ].header_style = "bold green"
114
- table .columns [6 ].style = "green"
114
+ table .columns [6 ].header_style = Color . BRIGHT_GREEN
115
+ table .columns [6 ].style = Color . GREEN
115
116
116
117
self .poutput (table )
117
118
You can’t perform that action at this time.
0 commit comments