Skip to content

Instantly share code, notes, and snippets.

@parnexcodes
Last active June 27, 2023 23:57
Show Gist options
  • Save parnexcodes/74fef2e33a2171031000a97c371a1a65 to your computer and use it in GitHub Desktop.
Save parnexcodes/74fef2e33a2171031000a97c371a1a65 to your computer and use it in GitHub Desktop.

As you can see key is on index 2 (index starts from 0)

before that there were 2 mpd urls.

So we start the range with 2 (therefore skipping 0 and 1 index which consists of mpd url).

for i in range(2, len(config)):

In amazon there was 1 extra mpd url after keys.

Key's location was at index 1 as 0 index was mpd_url.

We skipped last index using -1.

len(config) will give you total number of index values in keys.json file.

So if we subtract 1 from total, it removes the last extra mpd url.

for i in range(1, len(config)-1):

I hope you get the idea.

if this looks Complicated : Google Python Indexing , Python lists.

Copy link

ghost commented Aug 6, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment