step2 = Popen(['grep', 'inet6'], stdout=PIPE, stdin=step1.stdout)
step3 = Popen(['sed', '-e', '/fe80/d', '-e', 's/ *inet6 *//g', '-e',
    's/\\/64.*$//g'], stdout=PIPE, stdin=step2.stdout)
How to get the IPv6 address of an interface under linux