+ 2
How can I fix .../Playground/??
print('a/b/c/d') # OUTPUT: a.../Playground/ please help me to fix this 🙏
8 Answers
+ 1
Maybe this will work for you: 😎
print('a/b/c/d'.replace('/','\0/'))
+ 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
+ 1
Thanks Solo 😁😁
+ 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')
+ 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')
+ 1
Thanks 👍💯
+ 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/'