The TIBCO Platform is a real-time, composable data platform that will bring together an evolving set of your TIBCO solutions - and it's available now!
A chart showing the TIBCO Platform vision
Jump to content
Forums
Ask questions and gain insight from discussions

In Python, how can I eliminate the ANSI escape sequences from a string


Mubashshsir Hasan

Recommended Posts

This is a snippet with my string in it.

'lsrnx1b[00mx1b[01;31mexamplefile.zipx1b[00mrnx1b[01;31m'

The string was produced from an SSH command I ran. I can't use the string as it is since it contains ANSI-standard escape sequences. How can I delete the escape sequences programmatically so that the only part of the text that remains is

'examplefile.zip'

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...