Python Scratch, Notes

By pjain      Published April 21, 2020, 7:31 p.m. in blog Programming   

PY Learn Notes, Scratch


Panel 1 questions range on sorting, dictionaries in python, runtime complexity of O(1), min, max, defaultdict, sets.

Reverse a string

whiteboard questions were focused on rewriting standard Python library methods like sort()

r Py

Python Programming Tutorials


Py Data Structures - Pretty print

feed_url = '' r = feedparser.parse(feed_url) print(r.feed.title,, r.feed.description, r.feed.updated) # x, r.feed.published)

pprint.pprint(json.loads(json.dumps(r.feed))) pprint.pprint(json.loads(json.dumps(r.entries[0])))

program - arg1nm arg2url

import sys

feed_name = sys.argv[1] feed_url = sys.argv[2]

Time, Date manipulation

import time

print time.strftime("%a, %b %d %I:%M %p")

current_time_millis = lambda: int(round(time.time() * 1000)) current_timestamp = current_time_millis()

TDO: Py Misc

  • Unicode

  • Py 101

Command line and Basic Systems Programming

Command line and Console IO

File Systems and IO

File Systems for Python $TH File IO in Python $TH

Serialization, JSON

Web and Network Programming and IO

Topics in Python, Best Practices

Idiomatic Python Best Practices - Getting Good

Virtual Env

Setup a Local Python Environment $TH ~x PyCharm for Python Development $TH


SSH, Remote Toolchains


Write Better Python $TH

Functional Python and Stronger Typing

Py Core, DS, Algo

  • A Byte of Python

x Zed Shaw book, I had put it on hold while I was taking the U of M class, but it is very good... Learn Python the Hard Way by Zed Shaw. Link is here:

I strongly advise against this resource. It is deliberately obtuse, and outdated. It is literally the hard way to learn Python, and that does not make it a better way to learn.

==== Notes, Scr

Python3 isms

1 function type annotation = can be checked by mypy

def sum(x: int, y: int) -> int: return x + y

  • views def list_lists(request) -> HttpResponse:

PyCore, Algo

Python Data Structures and Algorithms: ProQuest Tech Books kwargs in python - Google Search How to use args and *kwargs in Python - SaltyCrane Blog

Learning Python Design Patterns - Second Edition: ProQuest Tech Books Lesson 1 - Python Programming (Automate the Boring Stuff with Python) - YouTube

Py Fn, HiPerf

  • Pkg

featherweight attributes Py classes slots


~/Library/Application Support/Google/Chrome

PKJ Py Expts Utilities Working

File rename for Android accuracy

import os dir = "." ld = os.listdir(dir) for l in ld: if (l[0]=='.'): continue #print(l) m = l.lower().strip().replace(" ","").replace("-","").replace(",","").replace("\","") os.rename(l,m)

ld = os.listdir(dir)

List image meta data

$ source ~/pyenv36/bin/activate $ brew install libtiff libjpeg webp little-cms2 $ pip install pillow

from PIL import Image, ExifTags import os dir = "." ld = os.listdir(dir) for l in ld: img = exif = { ExifTags.TAGS[k]: v for k, v in img._getexif().items() if k in ExifTags.TAGS } print(l,exif)


There are no comments yet

Add new comment

Similar posts

Python Learning Journey, Notes and Lessons - PKJ

Python Learning Guide and Resources SERIES

Graphs 101

Sublime Text, Plugins and Custom Programming in Python