Simple way.
with open("package.json") as f:
str_file = f.read()
print(str_file)
Using custom encoding.
with open("package.json", encoding = 'utf-8') as f:
str_file = f.read()
print(str_file)
Cheatsheet collection for go, rust, python, shell and javascript.
Simple way.
with open("package.json") as f:
str_file = f.read()
print(str_file)
Using custom encoding.
with open("package.json", encoding = 'utf-8') as f:
str_file = f.read()
print(str_file)