Semiconductor single-walled carbon nanotubes (sc-SWCNTs) exhibit exceptional optoelectronic properties and possess a substantial specific surface area, rendering them highly promising materials for the development of gas sensors with increasing the sensitivity and portability. In this study, we synthesized polymer bearing two Schiff base side chains (PF2L) via the Suzuki coupling reaction with enhanced polymer solubility. The sc-SWCNTs were selectively sorted using PF2L from commercially available SWCNTs to prepare PF2L/sc-SWCNTs composites. The incorporation of side chains enhanced the π-π interactions within the polymers and facilitated the interactions between the polymers and SWCNTs, thereby promoting superior dispersion of sc-SWCNTs. The PF2L/sc-SWCNTs-based sensors were fabricated using the drop-coating method, and their gas sensing performance was evaluated for gases with distinct properties (reducing: NH3 and oxidizing: NO2). The sensor exhibits a response of 2.415 % and 14.85 % for 1 ppm NH3 vapor and 1 ppm NO2, respectively. The sensor shows response and recovery times of 50 s and 220 s, respectively, for the detection of 1 ppm NH3 vapor, while it demonstrated response and recovery times of 59 s and 733 s for the detection of 1 ppm NO2. Subsequently, we developed an LED-based detection device for the selective discrimination of NH3 vapor and NO2, thereby offering valuable insights into the potential practical applications of a single material for dual gas sensing.