Created for
Created by
picture source: @imgur.com
from If programming languages were essays...
Python 2 will not be maintained past 2020
Python is an open source project: Python's github
Bulgarian | Python | |
---|---|---|
novel | <=> | program |
paragraph | <=> | block |
sentences | <=> | instructions |
types of sentences (declarative, imperative,...) | <=> | types of instructions (statements, expressions) |
grammar rules (can be ambiguous) | <=> | grammar rules (could not be ambiguous) |
block
.
$ python -m this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Or just read it here: The Zen of Python
That code will lead to
TabError: inconsistent use of tabs and spaces in indentation
That code will lead to
IndentationError: unexpected indent
Can you spot the bug?
Notebooks
into your main course folder
PJ_Course
├── lab1
│ ├── ...
├── Notebooks
# go to lab1 folder:
cd some/path/PJ_Course/lab1
# remove virtual env:
pipenv --rm
# remove Pipfile && Pipfile.lock
rm Pipfile Pipfile.lock
# go to PJ_Course folder (if you are in lab1/):
cd ../
# or if you are in new terminal, do:
cd some/path/PJ_Course/
# create a virtual environment with Python3:
pipenv --three
# install the modules:
pipenv install pandas matplotlib jupyterlab
# activate the virtual environment:
pipenv shell
# start the server
jupyter notebook
If you close that Terminal - you'll stop the Jupyter Notebook server, so make sure you leave it alone.
These slides are based on
customised version of
framework