Building electronic devices based on single molecules has been actively pursued in recent years as a promising alternative to the conventional silicon-based microelectronics. Indeed, many molecules possess wonderful electronic properties, but a critical challenge is to find a practical method to connect them to the outside world. We have developed a simple electrochemical method to fabricate nanoelectrodes separated with a molecular size gap, using conductance quantization and electron tunneling as feedback control. The tunneling current varies in a stepwise fashion due to atomic reconfiguration, making it possible to control the gap width with atomic precision. By bridging the gap with conducting polymers, we have studied electron transport through the polymer wires and demonstrated that the polymer wires can be switched between the insulating and conducting states with an electrochemical gate.