<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.8">
</HEAD>
<BODY>
i'm trying to display output from a linux command line program and i'm getting a lot of junk.<BR>
i was told that pulling out escape sequences like this regex: \033[^;]*; would do it but that doesnt catch them all. i'm seeing the little box characters for instance.<BR>
<BR>
the only way i've found thus far is this:<BR>
<BR>
building the regex object:<BR>
regex = re.compile(r'\033[^;]*;')<BR>
then passing each line of output through this:<BR>
line = regex.sub("",line)<BR>
junk = line.translate(identity, string.printable)<BR>
line = line.translate(identity, junk)<BR>
<BR>
i know there must be a better way!<BR>
is there a way to get a non-printable group of characters to search for? <BR>
<BR>
thanks,<BR>
aaron kunkle
</BODY>
</HTML>