Recently, there has been strong market demand for thin, lightweight, flexible and bendable electrodes to make lithium ion batteries (LIBs) or lithium-polymer batteries that are lighter and more flexible than the existing ones, and thus more capable of satisfying for portable soft or bendable electronic devices such as roll-up displays, integrated circuit smart cards and wearable devices for durability in everyday use[1]. In this respect, the concept of all-polymer based batteries and supercapacitors, introduced almost three decades ago[2], has recently gained renewed interest mainly due to long cycle life, low self-discharge rate, endurance to over-discharge, low manufacturing costs, and shape flexibility of conductive polymers. Several important conducting polymers such as polypyrrole (PPy) [3], polyaniline (PAN) [4], and polythiophene (PTh) [5] and their derivatives have been proved to be used not only as the cathode but also as the anode for the secondary battery because they are stable in air and have good electrochemical properties.On the other hand, considering the limited and uneven distribution of lithium minerals, room temperature sodium ion batteries (SIBs) have received growing attention because of their low cost and abundant supply. SIBs and LIBs share the same architecture of battery design. One of the major challenges for SIBs is to discover suitable electrode materials with high and stable sodium storage capabilities. The lithium or sodium storage mechanism of the conductive polymers is reversible n-doped behavior[6]. During discharge process, the cations (Li+ or Na+) stored between the chain layers of polymers and combined with oxygen atom to form oxide[3]. Therefore, the distance between the chain layers is important for the cations insertion and extraction, especially for the sodium ions with larger atomic radius. Among the conducting polymers, PPy have drawn the most attention due to their redox properties, biocompatibility, good electrical conductivity, and chemical stability. However, to the best of our knowledge, very few PPy materials have been reported for Na-ion storage. In this work, we propose PPy thin films with stable chain-layer structure as anodic electrodes for LIBs and SIBs, which synthesized by an easy, inexpensive and scalable vapor phase polymerization (VPP) technique[7]. The ordered pyrrolic chains layer structure of obtained PPy film was characterized by X-ray diffraction (XRD), High-resolution transmission electron microscopy (HR-TEM), Raman spectra and X-ray photoelectron spectra (XPS) examinations. As a consequence, the PPy film demonstrates excellent rate performance and cycling stability as freestanding anodic electrode for both Li-ion and Na-ion storage. In particular, the PPy film anode exhibits an impressive increased reversible capacity of 204.5 mAh g-1 even after 400 cycles at 10 C charge/discharge rate for Li-ion storage. Moreover, a reversible redox capacity of 113.8 mAh g-1 through doping-dedoping reactions of Na-ions into/from the PPy chains is also achieved. The electrochemical Li-ions and Na-ions doping-dedoping behaviors of PPy film was investigated by ex-situ XRD. It was proved that PPy film electrode could be reversibly charged and discharged with lithium and sodium and the ordered pyrrolic chains structure can self-adapt the doped ions. The results may substantially contribute to the progress of the flexible polymer electrode for various ions batteries. Acknowledgements: The authors gratefully acknowledge the support of the National Science Foundation of China (51472161, 51472160, 21403139), the Shanghai Pujiang Program (No. 14PJ1407100), the Key Program for the Fundamental Research of the Science and Technology Commission of Shanghai Municipality (15JC1490800, 12JC1406900) and the International Cooperation Program of the Science and Technology Commission of Shanghai Municipality (14520721700). We acknowledge the support of the Program for Professor of Special Appointment (Eastern Scholar) at Shanghai Institutions of Higher Learning (TP2014048) and the Hujiang Foundation of China (B14006).