Re: capturing stdout from lynx..

2006-03-13 Thread [EMAIL PROTECTED]
perfect!

that worked great!

thank you!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: capturing stdout from lynx..

2006-03-10 Thread Enigma Curry
Does this do what you want?

import os
filename = "test.html"
cmd = os.popen("lynx -dump %s" % filename)
output = cmd.read()
cmd.close()
print output

-- 
http://mail.python.org/mailman/listinfo/python-list


capturing stdout from lynx..

2006-03-10 Thread [EMAIL PROTECTED]
i have a huge database that contains large amounts of html that i need
to translate to ascii..

i have tried using html2text.py:

http://www.aaronsw.com/2002/html2text/

but i could not figure out how to import it and use it as a library
without getting errors everywhere..

so i decided to try using lynx with the -dump switch..

it works great from the command line, but i am having trouble capturing
the output into a python variable..

the only way i have figured out how to do it is:

s = subprocess(args='/sw/bin/lynx',stdout=subprocess.PIPE)

but i can't figure out how to send it the "-dump" or the
 and retrieve the ouput..

any help would be appreciated..

-- 
http://mail.python.org/mailman/listinfo/python-list