Skip to content
/ 100d-py Public

This repo will contain notes and mini projects in python

Notifications You must be signed in to change notification settings

shrysr/100d-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Introduction

This is a repo hosting my follow along code and notes from the TalkPython course 100 days of code with Python.

Prep

Outline of methodology and tools

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.

Adding the forked course material as a Subtree

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

Creating a folder directory to work in

mkdir -p 01_scripts/
mkdir -p 02_data
mkdir -p 03_notebooks

Creating a virtual environment for this course

Using conda:

conda create -n 100dpython

Activating the environment:

conda activate 100dpython

Installing bob’s requirements:

pip install -r requirements/bob-requirements.txt

Days 1-3

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")

Time delta


Days 4-6