title: Python pickling returning a string when I've pickled a dict?
body: <p>I'm currently learning about pickling in Python and I'm confused with an error I'm getting complaing that the unpickled variable I'm initalizing does not have a particular attribute I'm wanting to use.</p>
  
  <p>I'm pickling a dictionary of the script's data and then trying to <em>unpickle.load</em> it back using the following code:</p>
  
  <pre><code>def loadData():
      global script_data_filepath
      with open(script_data_filepath) as script_data_file:
          data_to_load = pickle.load(script_data_file)
          for data_item in data_to_load.items():
              print(data_item[0])
              print(data_item[1])
  </code></pre>
  
  <p>The problem is that Python is saying that <em>items()</em> is not an attribute of data_to_load because data_to_load is of type '<em>str</em>'. In the code I've given this is the first time that data_to_load is declared, I pressumed that it would dynamically take whatever type is assigned to it (which should be a dictionary as that's what I know will be loaded from this file).</p>