Integer -256, 15
Float -253.23, 1.253e-10
String "Hello", 'Goodbye', """Multiline"""
Boolean True, False
List [ value, ... ]
Tuple ( value, ... )
Dictionary { key: value, ... }
Set { value, value, ... }
Last active
September 5, 2016 10:59
-
-
Save lyndametref/4bd8526b0a1aa5f9491ba8d0add45ec2 to your computer and use it in GitHub Desktop.
Pyhton3 cheatsheet
email= [email protected]
org = email.split('@')[1] # org = 'b.c'
content = 'I have 10 fingers and 2 eyes'
re.findall('[0-9]+',content)] # returns ['10', '2']
https://www.crummy.com/software/BeautifulSoup/bs4/doc/
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'html.parser')
tags = soup.find_all('span')
https://packaging.python.org/installing/#creating-virtual-environments
3.3+ built-in. In Ubuntu:
sudo apt-get install python3-venv
can be added to 2.6+/3.1+ :
pip install virtualenv
3.3+: python3 -m venv my_venv_path
source my_venv_path/bin/activate
deactivate
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment