I have a space in the path and I try to use \ , but when I print the path, it gives me two \ in output. How can we avoid double \ as I need this path later to access on shell file.
source_list = ["/media/aqeel/My\Book/2018","/media/aqeel/My\Book/2019", "/media/aqeel/My\Book/2020"]
print(source_list)
['/media/aqeel/My\\Book/2018', '/media/aqeel/My\\Book/2019', '/media/aqeel/My\\Book/2020']
the expected output should be like this
['/media/aqeel/My\Book/2018', '/media/aqeel/My\Book/2019', '/media/aqeel/My\Book/2020']
Later I want to use this file to use with bash file as given below
os.system(f"sh utils/Event2SAC.sh {'"source"'} {tar_base+'/'}