in python,how to check sys.stdin
has data or not,
i found os.isatty(0)
only can check is connect to a tty device,but if some one use code like
sys.stdin=cStringIO.StringIO("ddd")
after that use os.isatty(0)
it's still return True,
what i need is check from stdin is have data,any advice is welcome