Fiber-based flexible thermoelectric (TE) materials are very promising for wearable electronics. Carbon nanotubes (CNTs) have shown considerable promise as thermoelectric materials, however, integrating CNTs into a fiber always lowers the performance, which limits the application of CNT-based fibers (CNTFs). This work proposes a low-cost and simple manufacturing process based on electrostatic spray technique to prepare high-performance CNTFs, whose TE and mechanical properties can be optimized by tuning spray voltage and time. With the aid of the optimized electrostatic field, the prepared CNTFs possess excellent durability and the electrical conductivity showing almost no degradation after being washed and deformed repeatedly. In addition, the CNTFs are proved to be easily converted into n-type via polyethyleneimine (PEI) doping process. Based on the prepared p- and n-type CNTFs, this work fabricates a π-type thermoelectric generator (TEG), of which the CNTFs show the ability to optimize thermal design to compensate negative effect of the intrinsic high thermal conductivity of CNTs on the output performance of the device. As a result, a maximum power of 26.2 nW with output voltage of 6.46 mV is achieved at a temperature difference of 33.4 K. This method provides a new way for preparing high-performance fiber-based TE materials.