Storing text from textview as JSON String
I just want to take input from TextView Or Any Text Clip And Store It In As A JSON String, including newlines and tabs. Lot of scripts teach how to strip escape characters, i want the program to insert them automatically.
It is taking me a lot of time to insert \n and \t manually.
I ultimately want to store a bunch recipes in JSON file, as simple dictionary.
Thank you. Ram
json.dumpcan be used to write a
dictinto a JSON file, and
json.loadto read a JSON file. The
jsonlibrary automatically escapes and unespaces all strings when writing/reading, that way you don't need to do any of that by hand.
Thank You @dgelessus ,
I have been sitting and editing JSON data files manually, inserting \n \b..