Question: I have a live video stream from FFMpeg, and I am having a hard time viewing the stream using my own custom Java application. Before someone tells me to use VLC or something like that I do want to use my own application. The stream I am trying to read is a H.264 encoded Mpeg-ts stream streamed over UDP. I do know how to decode the H.264 frames, but I am simply wondering about how to receive the Mpeg-ts stream.

Answer: 
Try this on:

`d = collections.OrderedDict({ i:'*'*i for i in range(8) })`

**EDIT**

`pprint.pprint(list(d.items()))`
If you are specifically targeting CPython\* 3.6 or later, then you can [just use regular dictionaries](https://docs.python.org/3.6/whatsnew/3.6.html#whatsnew36-compactdict) instead of `OrderedDict`. You'll miss out on a few [methods exclusive to `OrderedDict`](https://docs.python.org/3.6/library/collections.html#collections.OrderedDict), and this is not (yet) guaranteed to be portable to other Python implementations,\*\* but it is probably the simplest way to accomplish what you are trying to do.

\* CPython is the reference implementation of Python which may be downloaded from python.org.  

\*\* CPython [stole this idea from PyPy](https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html), so you can probably depend on it working there too.