Ganesh Kumar <bugcy...@gmail.com> writes: > Hi Guys, > > I have created regular expression with os modules, I have created file > sdptool to match the regular expression pattern, will print the result. > I want without creating file how to get required output, I tried but i > didn't get output correctly, over stream.
You should use the subprocess module to deal with external commands. >>> import subprocess >>> s = subprocess.Popen(["head", "/etc/hosts"], stdout = subprocess.PIPE) >>> hosts_head = s.stdout.read() >>> print hosts_head 127.0.0.1 localhost [...] Use that get your output and then parse it with the regexp. -- ~noufal http://nibrahim.net.in The best cure for insomnia is to get a lot of sleep. -W. C. Fields _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers