Python

HTML Parsing in Python 3.4 using LXML

HTML Parsing in Python 3.4 using LXML

LXML is a nice little document parser for lightweight and effective HTML/XML parsing without using regular expressions. The module can be installed with relative ease using pip and works for Python 2 and 3. Let’s get the token and expire form values from NYTimes site for an example. More

PyMySQL: Pure Python MySQL client, perfect for Python 3+

PyMySQL: Pure Python MySQL client, perfect for Python 3+

It took me a while to get MySQL working on Python 3.4. I started with MySQLDB, but figured it doesn’t work on Python 3 and above. Then I stumbled upon a nice pure-python MySQL client called PyMySQL. Guess what. It works! Here’s a tutorial on how to set it up on your Mac. More

Asynchronous HTTP Requests in Python 3.4

Asynchronous HTTP Requests in Python 3.4

I started learning Python last night. I will be lying if I say “it’s good”. I’ll tell you what, “it’s f**king good”. I am a polyglot programmer and diving in Python was a cinch. It felt as if I knew it already, because “it makes sense”. I’ve been playing around with Python 3.4 and here’s an experiment. More