Question: I would like to print specific data in a JSON but I get the following error: 

```sh
Traceback (most recent call last):
  File "script.py", line 47, in <module>
    print(link['data.file.url.short'])
TypeError: 'int' object has no attribute '__getitem__'

```

Here is the JSON: 

```
{ 
   "status":true,
   "data":{ 
      "file":{ 
         "url":{ 
            "full":"https://anonfile.com/y000H35fn3/yuh_txt",
            "short":"https://anonfile.com/y000H35fn3"
         },
         "metadata":{ 
            "id":"y000H35fn3",
            "name":"yuh.txt",
            "size":{ 
               "bytes":0,
               "readable":"0 Bytes"
            }
         }
      }
   }
}

```

I'm trying to get `data.file.url.short` which is the short value of the url 

Here is the script in question: 

```py
post = os.system('curl -F "file=@' + save_file + '" https://anonfile.com/api/upload')
link = json.loads(str(post))

print(link['data.file.url.short'])

```

Thanks

Answer: 
Other than os.system() return value mentioned by @John Gordon I think correct syntax to access `data.file.url.short` is `link['data']['file']['url']['short']`, since `json.loads` returns `dict`.
`os.system()` does not return the *output* of the command; it returns the *exit status* of the command, which is an integer.

If you want to capture the command's output, see [this question](https://stackoverflow.com/q/4760215/494134).