SHARE
TWEET

Untitled

a guest Sep 11th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import json
  2.  
  3.  
  4. def get_key(index, filename):
  5.     data = json.load(open(filename))
  6.     keys = list(data.keys())
  7.  
  8.     key = keys[index]
  9.     return data[key]
  10.  
  11.  
  12. def main():
  13.     filename = 'file.json'
  14.     key = get_key(1, filename)
  15.     print(key)
  16.  
  17.  
  18. if __name__ == '__main__':
  19.     main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top