Outut of the stdout: This is the output of the Stdout, after the command is executed.But I am unable to remove the ANsi Characters at all. The output is something is like this:
[2J[m
]0;c:\windows\system32\cmd.exeMicrosoft Windows [Version 10.0.17763.805][38X[38C
(c) 2018 Microsoft Corporation. All rights reserved.[28X[28C
[80X[80C
administrator@ANU-NW C:\Users\Administrator>[36X[36C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C
[80X[80C]0;Administrator: c:\windows\system32\cmd.exe
I tried the below, regex:
ansi_regex = re.compile(r'\*\[[0-9]*[ABCDEFGJKPSTLMXdsum]|\[[0-9;]*
[Hf]|\[[\?]*[125]{2}[hl]{1}')
But it doesnt work.Anyhelp, greatly appreciated.