title: In python, how to read a json file as input and get txt file as output? #jupyter notebook
body: <p>I am writing a code to analyze a JSON file. And I want my output as a txt file. The code is as follows..</p>
  
  <pre><code>inputFile = "C:\Users\nk\Documents\survey\data.json"
  outfile= "C:\Users\nk\Documents\survey\data_summary.txt"
  json_file = open(inputFile, 'r', encoding="utf8")
  jsondb = json.load(json_file)
  
  fs = open(outFile, 'w')
  
  #some loops in between
  
  fs.flush()
  fs.close()
  </code></pre>
  
  <p>after running this code in jupyter notebook, it is showing error like </p>
  
  <pre><code>inputFile = "C:\Users\nk\Documents\survey\data.json"              ^
  SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escap
  </code></pre>
  
  <p>What to do ? and how to write???  I am new to programming. </p>