This is a repo hosting my follow along code and notes from the TalkPython course 100 days of code with Python.
The development is done in Emacs with multi-language Org mode notebooks, from which code is wrangled to separate script files in specified locations as you see. The code is also exported directly to jupyter notebooks.
I’ve used submodules in the past, but apparently subtrees is a better approach for code that I will mostly use as a reference more than anything else. As usual magit helped make things rather simple.
Having a separate repository enables me to setup the project as desired and perhaps add more subtrees for different apps. It may be interesting to combine this notebook with streamlit apps
mkdir -p 01_scripts/
mkdir -p 02_data
mkdir -p 03_notebooks
Using conda:
conda create -n 100dpython
Activating the environment:
conda activate 100dpython
Installing bob’s requirements:
pip install -r requirements/bob-requirements.txt
A simple procedure to enter in Christmas as a date and calculate the number of days from today till Christmas.
from datetime import datetime
from datetime import date
datetime.today()
date.today()
type(datetime.today())
type(date.today())
today_date = date.today()
today_date.month
# Defining a date object
christmas_date = date(2019, 12, 25)
# Days until christmas_date
(christmas_date - today_date).days
(christmas_date - today_date)
if christmas_date is not today_date:
print("There are " + str((christmas_date - today_date).days) + " days left till Christmas")
else:
print("Today is Christmas")