title: Key 'boot_num' is not recognized when being interpreted from a .JSON file
body: <p>Currently, I am working on a Boot Sequence in Python for a larger project. For this specific part of the sequence, I need to access a .JSON file (<code>specs.json</code>), establish it as a dictionary in the main program. I then need to take a value from the .JSON file, and add <code>1</code> to it, using it's key to find the value. Once that's done, I need to push the changes to the .JSON file. Yet, every time I run the code below, I get the error:</p>
  <pre><code>bootNum = spcInfDat['boot_num']
  KeyError: 'boot_num'`
  </code></pre>
  <p>Here's the code I currently have:</p>
  <p>(Note: I'm using the Python <code>json</code> library, and have imported <code>dumps</code>, <code>dump</code>, and <code>load</code>.)</p>
  <pre><code># Opening of the JSON files
  spcInf = open('mki/data/json/specs.json',) # .JSON file that contains the current system's specifications. Not quite needed, but it may make a nice reference? 
  spcInfDat = load(spcInf)
  </code></pre>
  <p>This code is later followed by this, where I attempt to assign the value to a variable by using it's dictionary key (The <code>for</code> statement was a debug statement, so I could visibly see the Key):</p>
  <pre><code>for i in spcInfDat['spec']:
      print(CBL + str(i) + CEN)
  # Loacting and increasing the value of bootNum.
  bootNum = spcInfDat['boot_num']
  print(str(bootNum))
  bootNum = bootNum + 1
  </code></pre>
  <p>(Another Note: <code>CBL</code> and <code>CEN</code> are just variables I use to colour text I send to the terminal.)</p>
  <p>This is the interior of <code>specs.json</code>:</p>
  <pre><code>{
      &quot;spec&quot;: [
          {
              &quot;os&quot;:&quot;name&quot;,
              &quot;os_type&quot;:&quot;getwindowsversion&quot;,
              &quot;lang&quot;:&quot;en&quot;,
              &quot;cpu_amt&quot;:&quot;cpu_count&quot;,
              &quot;storage_amt&quot;:&quot;unk&quot;,
              &quot;boot_num&quot;:1
          }
      ]
  }
  </code></pre>
  <p>I'm relatively new with .JSON files, as well as using the Python <code>json</code> library; I only have experience with them through some GeeksforGeeks tutorials I found. There is a rather good chance that I just don't know how .JSON files work in conjunction with the library, but I figure that it would still be worth a shot to check here. The GeeksForGeeks tutorial had no documentation about this, as well as there being minimal I know about how this works, so I'm lost. I've tried searching here, and have found nothing.</p>
  <h2>Issue Number 2 </h2>
  <p>Now, the prior part works. But, when I attempt to run the code on the following lines:</p>
  <pre><code># Changing the values of specDict.
  print(CBL + &quot;Changing values of specDict... 50%&quot; + CEN)
  specDict ={
      &quot;os&quot;:name,
      &quot;os_type&quot;:ost,
      &quot;lang&quot;:&quot;en&quot;,
      &quot;cpu_amt&quot;:cr,
      &quot;storage_amt&quot;:&quot;unk&quot;,
      &quot;boot_num&quot;:bootNum
  }
  
  # Writing the product of makeSpec to `specs.json`.
  print(CBL + &quot;Writing makeSpec() result to `specs.json`... 75%&quot; + CEN)
  jsonobj = dumps(specDict, indent = 4)
  
  with open('mki/data/json/specs.json', &quot;w&quot;) as outfile:
      dump(jsonobj, outfile)
  </code></pre>
  <p>I get the error:
  <code>TypeError: Object of type builtin_function_or_method is not JSON serializable</code>.</p>
  <p>Is there a chance that I set up my dictionary incorrectly, or am I using the <code>dump</code> function incorrectly?</p>