Skip to content

Instantly share code, notes, and snippets.

@tecnodur
tecnodur / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Created May 7, 2019 22:25 — forked from IamAdiSri/Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
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
@tecnodur
tecnodur / gist:4d8870e24c2f634137d28c2b16e4b7b2
Created April 26, 2017 21:12
Get all text from html page
# http://stackoverflow.com/questions/328356/extracting-text-from-html-file-using-python
import urllib
from bs4 import BeautifulSoup
url = "http://news.bbc.co.uk/2/hi/health/2284783.stm"
html = urllib.urlopen(url).read()
soup = BeautifulSoup(html)
# kill all script and style elements