print('a/b/c/d') # OUTPUT: a.../Playground/ please help me to fix this ๐
5/14/2022 1:47:19 PM
MD. Ferdous Ibne Abu Bakar8 Answers
New Answerit's a SL playground issue. Works fine in other IDEs. hope these helps.. https://www.sololearn.com/Discuss/1018921/?ref=app read code comments.. https://code.sololearn.com/c6tjlgd7XOAy/?ref=app
#My code: def Print(str): import os os.system('touch file.png') str = str.replace('/','<span>/</span>') print('<style>img{display:none}</style>'+str) Print('a/b/c/d')
MD. Ferdous Ibne Abu Bakar ๐ณ... oh great code ๐โบ๏ธ In this case, my function is: def Print(str): print(str.replace('/','\0/')) Print('a/b/c/d')
#How can i fix this: Solo any suggestions? def x(y): y = y.replace('/','\0/') return y import os a = x('/usr/bin/ptx') print(f'Current derection: {x(os.getcwd())}') print('='*20) print(f'Changing derection to: {a}') print('='*20) try: os.chdir(a) #ValueError: embedded null byte except: os.chdir('/usr/bin/ptx') #NotADirectoryError: [Errno 20] Not a directory: '../Playground/'
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message