A fluorescent compound, 4-(2,4,6-trimethoxyphenyl)-2-(2,5-dioxo-2H-pyrrol-1(5H)-yl)-6-phenylpyridine-3-carbonitrile (MAP), was synthesized through a one-pot reaction method. The homo-poly(pyridine–maleimide) was then prepared by polymerizing the synthesized MAP with pyridine–maleimide monomer in the presence of AIBN as an initiator. The structures of MAP, the pyridine–maleimide monomer, and their polymer derivatives were confirmed using ¹H NMR and ¹³C NMR spectroscopy. Their optical and thermal properties were investigated in ethanol using UV–Vis absorption spectroscopy. MAP exhibited weak blue fluorescence (λ_max = 500 nm) in polar aprotic solvents. Furthermore, the emission spectra of the homo-polymer showed noticeable differences between polar and non-polar solvents, indicating solvatochromic behavior.