Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.07 KB

File metadata and controls

33 lines (22 loc) · 1.07 KB

Python Examples

Various Code Snippets on different topics about Python

  1. [namedtuple_benchmark] (namedtuple_benchmark.py)

    An example of comparison between namedtuple and dict assignment. Shows the cost of readability of namedtuples over dict's integer index.

  2. [mmap] (mmap)

    Examples on how to use mmap module in python. Includes reading, writing (using slices and only in memory a.k.a. ACCESS_COPY) and regex finds. The example comes from PYMOTW article on mmap.

  3. Sorting

    Code snippets demonstrating various sorting algorithms implemented in Python. See tests.py for written tests.

  4. [merge_sort] (merge_sort.py)

  5. Color in terminal

    Color in terminal

  6. Requests - Requests-futures

    A small example in terms of demonstrating the parallelization of requests-futures package. Syncronous example using plain requests and Asyncronous example using requests-futures