Computational spectrometers enable low-cost, in-situ, and rapid spectral analysis, with applications in chemistry, biology, and environmental science. Traditional filter-based spectral encoding approaches typically use filter arrays, complicating the manufacturing process and hindering device consistency. Here we propose a computational spectrometer spanning visible to mid-infrared by combining the Single-Spinning Film Encoder (SSFE) with a deep learning-based reconstruction algorithm. Optimization through particle swarm optimization (PSO) allows for low-correlation and high-complexity spectral responses under different polarizations and spinning angles. The spectrometer demonstrates single-peak resolutions of 0.5 nm, 2 nm, 10 nm, and dual-peak resolutions of 3 nm, 6 nm, 20 nm for the visible, near, and mid-infrared wavelength ranges. Experimentally, it shows an average MSE of 1.05 × 10⁻³ for narrowband spectral reconstruction in the visible wavelength range, with average center-wavelength and linewidth errors of 0.61 nm and 0.56 nm. Additionally, it achieves an overall 81.38% precision for the classification of 220 chemical compounds, showcasing its potential for compact, cost-effective spectroscopic solutions.