Asynchronous HTTP requests in Python 3.5

Just a snippet with aiohttp.

import aiohttp
import asyncio

async def get_status(url, id):
    r = await aiohttp.get(url)
    print(r.status, id)
    r.close()


tasks = []
for i in range(100):
    tasks.append(asyncio.ensure_future(get_status('https://api.github.com/events', id=i)))


if...
  2015-11-09   2427   Loadingpythonasyncio  Read More

How to Watermark A Video with Python

Why Watermarking?

Preventing people from saving video contents from your web site is never possible, because, firstly, video contents are always streamed to users' device, users just cannot watch the video without retrieving it, secondly, people can always do a screen recording to save content.

...

A Python Web Crawler Helper

I was tired of writing the similar bit of code every time I wanted to craw something from the web. So, I wrote this helper to save the boring part of the work.

I call it a helper because it's definitely not a framework and it's so simple that I don't want to call it a library. It's also the firs...

  2015-10-09   11685   Loadingpythoncrawler  Read More