Show Menu
Cheatography

Python quick reference

List

A = [1,2,3]
B = A[:]
create new list as copy

Enviro­nments

conda create --name <env name> python­=<v­ers­ion>
create enviro­nment
conda activate <env name>
activate enviro­nment
conda deactivate
deactivate enviro­nment
conda install <pkg name>
install package
conda update conda
update conda
conda info
verify conda is installed, check version number
conda env list
list of enviro­nments
conda list
list all packages and versions installed in active enviro­nment
conda list --explicit > <text file>
save enviro­nment to a text file
conda env create --file <text file>
create enviro­nment from a text file
where python
location of python installs
python --version
python version
 

Change jupyter notebook start directory

jupyter notebook --gene­rat­e-c­onfig
This writes a file to C:\Use­rs­\use­rna­me\.ju­pyt­er­\jup­yte­r_n­ote­boo­k_c­onf­ig.py
Change this line
#c.Not­ebo­okA­pp.n­ot­ebo­ok_dir = ''
to this text
c.Note­boo­kAp­p.n­ote­boo­k_dir = '/the/­pat­h/t­o/h­ome­/fo­lder/'
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

            Python 3 Cheat Sheet by Finxter

          More Cheat Sheets by shribee

          Git Cheat Sheet