'''
f = open(r"C:\Users\ocwot\Desktop\파이썬 연습\example.txt",'a+' ,encoding='utf-8')
f.write('Deae,') #Add Data
f.seek(0)
print(f.read())
f.close()
'''
f = open(r"C:\Users\ocwot\Desktop\파이썬 연습\example.txt", encoding='utf-8')
print(f.read())
The txt file contains: Deae,Deae,Deae,Deae,DeaeDeae, There's an article like this.
I understand that the code in '' is annotated and does not affect it. If you erase the content of the annotation, it's not a mistake. 지우지 않으면 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 14-15: truncated \UXXXXXXXX escape PSC:\Users\ocwot\Desktop\Python Practice> This error occurs. I don't know why.
python
"""
Annotation
"""
© 2024 OneMinuteCode. All rights reserved.