In this article we will learn about some of the frequently asked about Python programming questions in technical like “read […]
Category: Python
“’str’ object is not callable” Code Answer’s
In this article we will learn about some of the frequently asked about Python programming questions in technical like “’str’ […]
Existing PostgreSQL ENUMs in Alembic
If you drop/modify a table or try to add a column using an existing ENUM, alembic will complain: sqlalchemy.exc.ProgrammingError: (ProgrammingError) […]
Image Cropping using PyGame
According to this post , this script launch a PyGame windows with the image you’ve passed in input_loc and let’s […]
Have Django prepend https to links
If you are trying to build a secure site setting up https is the first step. With Django if you […]
Installing mac apps in a giffy. With AlfredApp.
I’ve had to setup at least 5 new macs for dev from scratch, and each time it was a pain. […]
bbcli – browse BBC News in the command line.
bbcli -browse BBC News in the command line. instalation and usage: pip install bbcli and then in the terminal: bbcli […]
Pretty Print JSON in the Terminal
Working with JSON on command line can be tough to read, use this Python one-liner, to clean it up. cat […]
Format json output
Usage some-not-formated-json-string | python -mjson.tool Exemple Creation of a json.php script which outputs a JSON string: <?php $a = array( […]
crawlAmazon
Everyone can get source code from github(https://github.com/dome2322/crawlAmazon.git). the project are: 1.get product image and text from Amazon.com 2.built with Python […]
Escape accent letters python
strescaped = urllib.quote(password, safe=’àèéìòù”£’).decode(‘utf-8’).encode(‘latin-1’) formdata = {‘jusername’: username, ‘jpassword’:str_escaped}
Python + XML = Scripting Joy
lxml (http://lxml.de/) in python is fast efficient and effective. Perfect for those command line scripts that need a simple config […]
Python: Exploratory data analysis
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set_style(‘whitegrid’) FILE_NAME = ‘../input/example.csv’ […]
Open-source ecommerce framework for Django
Oscar is an excellent option if you are looking for an open-source ecommerce framework for Django. http://oscarcommerce.com/
Using better CLIs
For people who spend half of their lives in a terminal user experience and functionality is highly important. Making you […]
Javascript range / list comprehensions
I was looking how to use a python-equivalent range function. The closest I found is Array.apply(null, Array(16)).map( function (_, i) […]
Awesomer nose tests with progress
Watching Eric Rose’s dubiously titled talk on Nose was extremely interesting. The most immediately useful takeway was nose-progress, which makes […]
Flatten a list of lists in one line in Python
Sometimes you need to flatten a list of lists. The old way would be to do this using a couple […]
Separating API groups
This is more or less an idea I had a couple weeks ago, and the more I think about it, […]
Subtle bug: missing commas in iterables
One of Python’s features that I am not fond of is the implicit concatenation syntax. Two strings places side by […]