tng-cast.html


001| 
002| Title = """\
002| ST:TNG
002| https://en.wikipedia.org/wiki/Star_Trek%3A_The_Next_Generation
002| https://en.wikipedia.org/wiki/List_of_Star_Trek:_The_Next_Generation_cast_members
002| """

003| 
004| ListInfo = """\
004| Patrick Stewart; 1940-2026; 86
004| https://en.wikipedia.org/wiki/Patrick_Stewart
004| Jean-Luc Picard
004| https://en.wikipedia.org/wiki/Jean-Luc_Picard
004| 
004| Jonathan Frakes; 1952-present; 74
004| https://en.wikipedia.org/wiki/Jonathan_Frakes
004| William Riker
004| https://en.wikipedia.org/wiki/William_Riker
004| 
004| LeVar Burton; 1957-present; 69
004| https://en.wikipedia.org/wiki/LeVar_Burton
004| Geordi La Forge
004| https://en.wikipedia.org/wiki/Geordi_La_Forge
004| 
004| Michael Dorn; 1952-present; 73
004| https://en.wikipedia.org/wiki/Michael_Dorn
004| Worf
004| https://en.wikipedia.org/wiki/Worf
004| 
004| Gates McFadden; 1949-present; 77
004| https://en.wikipedia.org/wiki/Gates_McFadden
004| Beverly Crusher
004| https://en.wikipedia.org/wiki/Beverly_Crusher
004| 
004| Marina Sirtis; 1955-present; 71
004| https://en.wikipedia.org/wiki/Marina_Sirtis
004| Deanna Troi
004| https://en.wikipedia.org/wiki/Deanna_Troi
004| 
004| Brent Spiner; 1949-present; 77
004| https://en.wikipedia.org/wiki/Brent_Spiner
004| Data
004| https://en.wikipedia.org/wiki/Data_(Star_Trek)
004| 
004| Wil Wheaton; 1972-present; 54
004| https://en.wikipedia.org/wiki/Wil_Wheaton
004| Wesley Crusher
004| https://en.wikipedia.org/wiki/Wesley_Crusher
004| 
004| Whoopi Goldberg; 1955-present; 70
004| https://en.wikipedia.org/wiki/Whoopi_Goldberg
004| Guinan
004| https://en.wikipedia.org/wiki/Guinan_(Star_Trek)
004| 
004| John de Lancie; 1948-present; 78
004| https://en.wikipedia.org/wiki/John_de_Lancie
004| Q
004| https://en.wikipedia.org/wiki/Q_(Star_Trek)
004| 
004| Denise Crosby; 1957-present; 68
004| https://en.wikipedia.org/wiki/Denise_Crosby
004| Tasha Yar
004| https://en.wikipedia.org/wiki/Tasha_Yar
004| 
004| Diana Muldaur; 1938-present; 88
004| https://en.wikipedia.org/wiki/Diana_Muldaur
004| Katherine Pulaski
004| https://en.wikipedia.org/wiki/Katherine_Pulaski
004| 
004| """

005| 
006| 
007| state = 1
008| link_info = {}
009| 
010| print('<ul style="color:black;">')
011| for line in ListInfo.splitlines():
012|     match state:
013|         case 1:
014|             name,years,age = line.split('; ')
015|             if 'present' in years:
016|                 years = years.replace('present', '<em>curr</em>')
017|             link_info['actor'] = name,years,age
018|             state = 2
019|         case 2:
020|             link_info['actor.link'] = line
021|             state = 3
022|         case 3:
023|             link_info['char'] = line
024|             state = 4
025|         case 4:
026|             link_info['char.link'] = line
027|             state = 5
028|         case 5:
029|             if line:
030|                 raise RuntimeError(f'Expected a blank line, but got "{line}"')
031| 
032|             # Create the list item...
033|             name,years,age = link_info['actor']
034|             lnk1 = link_info['actor.link']
035|             char = link_info['char']
036|             lnk2 = link_info['char.link']
037| 
038|             # Print the list item...
039|             print(f'<li><a href="{lnk2}">{char}</a>: <a href="{lnk1}"><strong>{name}</strong></a> ({years}; <strong>{age}</strong>)</li>')
040| 
041|             # Reset for next one...
042|             state = 1
043|             link_info = {}
044|         case _:
045|             raise RuntimeError(f'Unexpected state: {state}')
046| 
047| print('</ul>')
048| print()
049| 
050| 
051| 
052| """eof"""
053|