In the present work, the synthesis, photochromism and electrochemistry of a novel material 1, 1-(4-[3,4-bis(2,5-dimethyl-3-thienyl)cyclopent-3-en-1-yl]phenyl)-2,5-di-2-thienyl-1H-pyrrole, with pendant dithienylethene (DTE) photochromic units are described. It should be noted that the system I can be reversibly and efficiently switched between open (1o) and closed (1c) states by light in both solution and in the solid poly(methyl methacrylate) matrix. It is also noteworthy that the two isomers (1o and 1c) of this novel system 1 can be smoothly polymerized on ITO by electrochemical means. Surprisingly, the DTE unit in I does not retain its photochemical switching properties after immobilization onto ITO. The morphology of the polymer film was investigated by AFM analysis. Furthermore, it was found that the polymer exhibited remarkable electrochromic features that can be switched from green in the neutral state to violet state under applied external potentials without disturbing the photochromic units. (C) 2014 Elsevier Ltd. All rights reserved.