How can I fix .../Playground/?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How can I fix .../Playground/??

print('a/b/c/d') # OUTPUT: a.../Playground/ please help me to fix this 🙏

14th May 2022, 1:47 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
8 Answers
+ 1
Maybe this will work for you: 😎 print('a/b/c/d'.replace('/','\0/'))
14th May 2022, 4:30 PM
Solo
Solo - avatar
+ 4
it'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
14th May 2022, 2:07 PM
Jayakrishna 🇮🇳
+ 1
Thanks Solo 😁😁
14th May 2022, 4:32 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
+ 1
#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')
14th May 2022, 4:34 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
+ 1
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')
14th May 2022, 4:49 PM
Solo
Solo - avatar
+ 1
Thanks 👍💯
14th May 2022, 4:51 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
+ 1
#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/'
15th May 2022, 1:19 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar