I need to remove WindowsPath(
and some of the closing parentheses )
from a directory string.
x= (WindowsPath('D:/test/1_birds_bp.png'),WindowsPath('D:/test/1_eagle_mp.png'))
What I need to have is
x= ('D:/test/1_birds_bp.png', 'D:/test/1_eagle_mp.png')
I don't know how to do multiple strings at once.
by following @MonkeyZeus I tried;
y = [re.sub("(?<=WindowsPath\(').*?(?='\))",'',a) for a in x]
TypeError: expected string or bytes-like object