TL;DR
Install Postgres 9.5, and then:
sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main| First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py | |
| $ cd <download location> | |
| $ sudo -H python ./get-pip.py | |
| Installing pip also installs Python3 | |
| To run Python3 | |
| $ python3 | |
| Install pip3 by just executing the same file as in the step above, but this time using Python3 | |
| $ sudo -H python3 ./get-pip.py |
TL;DR
Install Postgres 9.5, and then:
sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main| Versions: | |
| python : 2.7.1 | |
| openpyxl : 2.2.5 | |
| pyexcelerate: 0.6.6 | |
| xlsxwriter : 0.7.3 | |
| xlwt : 1.0.0 | |
| Dimensions: | |
| Rows = 10000 |
| #!/usr/bin/env python | |
| ''' | |
| This script will attempt to open your webbrowser, | |
| perform OAuth 2.0 authentication and print your access token. | |
| To install dependencies from PyPI: | |
| $ pip install oauth2client | |
| Then run this script: |
| workon is a function | |
| workon () | |
| { | |
| typeset -a in_args; | |
| typeset -a out_args; | |
| in_args=("$@"); | |
| if [ -n "$ZSH_VERSION" ]; then | |
| i=1; | |
| tst="-le"; | |
| else |
| import pdfkit | |
| from django.http import HttpResponse | |
| from django.template import loader | |
| def create_pdf(request): | |
| """ | |
| url: https://learnbatta.com/blog/django-html-to-pdf-using-pdfkit-and-wkhtmltopdf-5/ | |
| """ | |
| html = loader.render_to_string('invoice.html', {}) | |
| output= pdfkit.from_string(html, output_path=False) |
| class Person(object): | |
| def __init__(self, first_name, last_name): | |
| self.first_name = first_name | |
| self.last_name = last_name | |
| @property | |
| def full_name(self): | |
| return self.first_name + ' ' + self.last_name | |
| @full_name.setter | |
| def full_name(self, value): | |
| first_name, last_name = value.split(' ') |
| def mgetattr(obj, lookup): | |
| # deep attribute lookup | |
| for attr in lookup.split('.'): | |
| obj = getattr(obj, attr) | |
| return obj |
| <script type="application/ld+json"> | |
| { | |
| "@context": "http://schema.org", | |
| "@type": "BlogPosting", | |
| "mainEntityOfPage":{ | |
| "@type":"WebPage", | |
| "@id":"http://applefostering.co.uk/skills-foster/" | |
| }, | |
| "headline": "The Skills to Foster", | |
| "image": { |
| class Fibonacci: | |
| def __init__(self, limit): | |
| self.limit = limit | |
| self.counter = 0 | |
| self.fib_data = [] | |
| def __iter__(self): | |
| return self | |
| def next(self): |