POPULARITY
What goes into updating one of the most popular books about working with Python? After a decade of changes in the Python landscape, what projects, libraries, and skills are relevant to an office worker? This week on the show, we speak with previous guest Al Sweigart about the third edition of "Automate the Boring Stuff With Python."
What can you learn from feeding an entire book on Python programming into ChatGPT-4 and asking it to provide a technical review? What are the potential pitfalls of using an LLM as a learning tool? This week on the show, author Al Sweigart talks about his recent experiments using ChatGPT and Python.
After years of being atop our "must-have guests" list, Kelly and Sean finally get to interview Al Swigart, author of Automate the Boring Stuff with Python, as well as many other books and courses that help people learn Python more effectively Join us as we talk about everything from our favorite teaching examples, the process of book writing, fostering cats, and more. Special Guest: Al Sweigart.
Chris Svec joined us to talk about kids programming and how well the Joel Test has held up. Svec's son (“The Kid”) developed an interest in programming by playing games. Most of his programming desires are around building games of his own. Any time we talk about kids and programming, Scratch comes up. It really is that neat and is The Kid approved. Some resources to get you started (actually, getting started is easy, you may want a book to do more than the basics): The Everything Kids' Scratch Coding Book: Learn to Code and Create Your Own Cool Games! by Jason Rukman Scratch 3 Programming Playground: Learn to Program by Making Cool Games by Al Sweigart (hey, we know that guy!) griffpatch on YouTube Digipen.edu had two courses The Kid (and Svec) took. Both are free on YouTube: Introduction to Game Design Lessons DigiPen Basic Game Development Series Finally, in a shockingly unrelated twist, we talked about the Joel Test for determining the health of a software development organization. No determination was made on how good The Kid finds his current position. Transcript
Welcome to The Nonlinear Library, where we use Text-to-Speech software to convert the best writing from the Rationalist and EA communities into audio. This is: A Barebones Guide to Mechanistic Interpretability Prerequisites, published by Neel Nanda on November 29, 2022 on The Effective Altruism Forum. Co-authored by Neel Nanda and Jess Smith Crossposted on the suggestion of Vasco Grilo Why does this exist? People often get intimidated when trying to get into AI or AI Alignment research. People often think that the gulf between where they are and where they need to be is huge. This presents practical concerns for people trying to change fields: we all have limited time and energy. And for the most part, people wildly overestimate the actual core skills required. This guide is our take on the essential skills required to understand, write code and ideally contribute useful research to mechanistic interpretability. We hope that it's useful and unintimidating. :) Core Skills: Maths: Linear Algebra: 3Blue1Brown or Linear Algebra Done Right Core goals - to deeply & intuitively understand these concepts: Basis Change of basis That a vector space is a geometric object that doesn't necessarily have a canonical basis That a matrix is a linear map between two vector spaces (or from a vector space to itself) Bonus things that it's useful to understand: What's singular value decomposition? Why is it useful? What are orthogonal/orthonormal matrices, and how is changing to an orthonormal basis importantly different from just any change of basis? What are eigenvalues and eigenvectors, and what do these tell you about a linear map? Probability basics Basics of distributions: expected value, standard deviation, normal distributions Log likelihood Maximum value estimators Random variables Central limit theorem Calculus basics Gradients The chain rule The intuition for what backprop is - in particular, grokking the idea that backprop is just the chain rule on multivariate functions Coding: Python Basics The “how to learn coding” market is pretty saturated - there's a lot of good stuff out there! And not really a clear best one. Zac Hatfield-Dodds recommends Al Sweigart's Automate the Boring Stuff and then Beyond the Basic Stuff (both readable for free on inventwithpython.com, or purchasable in books); he's also written some books of exercises. If you prefer a more traditional textbook, Think Python 2e is excellent and also available freely online. NumPy Basics Try to do the first ~third of these:. Bonus points for doing them in pytorch on tensors :) ML: Rough grounding in ML. fast.ai is a good intro, but a fair bit more effort than is necessary. For an 80/20, focus on Andrej Karpathy's new video explaining neural nets: PyTorch basics Don't go overboard here. You'll pick up what you need over time - learning to google things when you get confused or stuck is most of the real skill in programming. One goal: build linear regression that runs in Google Colab on a GPU. Transformers - probably the biggest way mechanistic interpretability differs from normal ML is that it's really important to deeply understand the architectures of the models you use, all of the moving parts inside of them, and how they fit together. In this case, the main architecture that matters is a transformer! (This is useful in normal ML too, but you can often get away with treating the model as a black box) Check out the illustrated transformer Note that you can pretty much ignore the stuff on encoder vs decoder transformers - we mostly care about autoregressive decoder-only transformers like GPT-2, which means that each token can only see tokens before it, and they learn to predict the next token Good (but hard) exercise: Code your own tiny GPT-2 and train it. If you can do this, I'd say that you basically fully understand the transformer architecture. Example of basic training boilerplate and train script The EasyTransformer codebase is probably good to riff off of here An ...
Welcome to The Nonlinear Library, where we use Text-to-Speech software to convert the best writing from the Rationalist and EA communities into audio. This is: A Barebones Guide to Mechanistic Interpretability Prerequisites, published by Neel Nanda on October 24, 2022 on The AI Alignment Forum. Co-authored by Neel Nanda and Jess Smith Why does this exist? People often get intimidated when trying to get into AI or AI Alignment research. People often think that the gulf between where they are and where they need to be is huge. This presents practical concerns for people trying to change fields: we all have limited time and energy. And for the most part, people wildly overestimate the actual core skills required. This guide is our take on the essential skills required to understand, write code and ideally contribute useful research to mechanistic interpretability. We hope that it's useful and unintimidating. :) Core Skills: Maths: Linear Algebra: 3Blue1Brown or Linear Algebra Done Right Core goals - to deeply & intuitively understand these concepts: Basis Change of basis That a vector space is a geometric object that doesn't necessarily have a canonical basis That a matrix is a linear map between two vector spaces (or from a vector space to itself) Bonus things that it's useful to understand: What's singular value decomposition? Why is it useful? What are orthogonal/orthonormal matrices, and how is changing to an orthonormal basis importantly different from just any change of basis? What are eigenvalues and eigenvectors, and what do these tell you about a linear map? Probability basics Basics of distributions: expected value, standard deviation, normal distributions Log likelihood Maximum value estimators Random variables Central limit theorem Calculus basics Gradients The chain rule The intuition for what backprop is - in particular, grokking the idea that backprop is just the chain rule on multivariate functions Coding: Python Basics The “how to learn coding” market is pretty saturated - there's a lot of good stuff out there! And not really a clear best one. Zac Hatfield-Dodds recommends Al Sweigart's Automate the Boring Stuff and then Beyond the Basic Stuff (both readable for free on inventwithpython.com, or purchasable in books); he's also written some books of exercises. If you prefer a more traditional textbook, Think Python 2e is excellent and also available freely online. NumPy Basics Try to do the first ~third of these:. Bonus points for doing them in pytorch on tensors :) ML: Rough grounding in ML. fast.ai is a good intro, but a fair bit more effort than is necessary. For an 80/20, focus on Andrej Karpathy's new video explaining neural nets: PyTorch basics Don't go overboard here. You'll pick up what you need over time - learning to google things when you get confused or stuck is most of the real skill in programming. One goal: build linear regression that runs in Google Colab on a GPU. Transformers - probably the biggest way mechanistic interpretability differs from normal ML is that it's really important to deeply understand the architectures of the models you use, all of the moving parts inside of them, and how they fit together. In this case, the main architecture that matters is a transformer! (This is useful in normal ML too, but you can often get away with treating the model as a black box) Check out the illustrated transformer Note that you can pretty much ignore the stuff on encoder vs decoder transformers - we mostly care about autoregressive decoder-only transformers like GPT-2, which means that each token can only see tokens before it, and they learn to predict the next token Good (but hard) exercise: Code your own tiny GPT-2 and train it. If you can do this, I'd say that you basically fully understand the transformer architecture. Example of basic training boilerplate and train script The EasyTransformer codebase is probably good to riff off of here An alternate framing that may help give different intui...
Watch the live stream: Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Michael #1: Human regular expressions revisited via Mikael Honkala We mentioned of Al Sweigart's humre in Python Bytes… Mikael went on a little search and compiled my findings into this repo. A lot of people feel that re needs some help. At least 3 of the "serious" packages I found came out in the last few months. Since a package like this is not overly complex to make, all the ways to approach the problem are clearly being explored. Unfortunately these seem to be mostly single-person efforts, and many have fallen to the wayside before long. Hopefully there's some consolidation on the horizon, to share some of the maintenance effort and establish some of the packages as here for the long haul. The list could be useful to you if you are: Looking for a tool: Check the list to get a quick idea of the "look and feel" of each package. Thinking about building a tool: Check the list for alternative approaches, and maybe consider if contributing to an existing package might be a better way to get what you need. Building a tool, or already have one: Use the list to clarify and communicate what the main differences and strengths of your solution are. Brian #2: Implicit Optional Types Will Be Disabled by Default … in a future mypy feature release (possibly the next one after 0.98x) … Thanks Adam Johnson for spotting this and letting us know Stop doing this: s: str = None Do one of these: s: str | None = None s: Union[str, None] = None s: Optional[str] = None ← but this has problems Optional != optional From python docs: ”Optional[X] is equivalent to X | None (or Union[X, None]).” “Note that this is not the same concept as an optional argument, which is one that has a default. An optional argument with a default does not require the Optional qualifier on its type annotation just because it is optional. “ Best described in FastAPI docs, Python Types Intro, starting at “Possibly None" Recommendation is to use: s: str | None = None for Python 3.10+ s: Union[str, None] = None for Python 3.9+ For 3.7, 3.8, you still have Optional as an option, I think. Why haven't you upgraded to 3.9? We're almost to 3.11, what's the problem?! Michael #3: cython-lint by Marco Gorelli A tool (and pre-commit hook) to lint Cython files, similar to how flake8 lints Python files, and works by parsing Cython's own AST (abstract syntax tree). Found quite a few nice clean-ups which could be applied on: pandas numpy scikit-learn cupy Brian #4: difftastic - structural diff “Difftastic is a structural diff tool that understands syntax.” “Difftastic detects the language, parses the code, and then compares the syntax trees.” Interesting story about building difftastic For one off git diff replacement use GIT_EXTERNAL_DIFF=difft git diff or GIT_EXTERNAL_DIFF="difft --syntax-highlight=off" git diff To always use difft with git, see https://difftastic.wilfred.me.uk/git.html Extras Brian: Oh My Git! - An open source game about learning Git! Python 3.11.0 is up to rc2 Michael: NextDNS Joke: I mean, who's wrong?
Have you wanted to understand recursion and how to use it in Python? Are you familiar with the call stack and how it relates to tracebacks? This week on the show, Al Sweigart talks about his new book, "The Recursive Book of Recursion."
Robotics Process Automation is probably not a term you hear about a lot in the techosystem and probably for good reason too. On this episode, Olaoluwa Daramola, a technology consultant at a big 4 company focusing on RPA, joins the hosts to discuss RPA and what it's like to succeed in the field. He also answers the question as to why RPA isn't so popular in the techosystem. You can reach out to the Olaoluwa, on Twitter, @__Laolu. Follow #InsidetheTechosystem on Twitter & Instagram: (@insidethetechos) Send any questions or feedback you have to insidethetechosystem@gmail.com Follow @Cnwadiogbu on Twitter Show Notes & Resources (04:45) - Olaoluwa's Twitter handle: https://twitter.com/__Laolu (10:12) - Automate the boring stuff with Python, a book by Al Sweigart: https://automatetheboringstuff.com (13:08) - Tech transfer season episode: https://anchor.fm/insidethetechosystem/episodes/Episode-10---Tech-Transfer-Season-epovqb (22:43) - RPA industry to reach about $25 billion by 2025: https://www.forrester.com/report/the-rpa-market-will-grow-to-usd22-billion-by-2025/RES177085 (26:34) - Is RPA only business-facing? (29:23) - How do RPA's get distributed? (33:29) - UiPath: https://www.uipath.com (35:40) - Microsoft acquiring a couple of RPA companies: https://www.infoq.com/articles/cloud-vendors-low-code (41:47) - Why is there little hype around RPA in the Nigerian Techosystem? (50:30) - What does it mean to be an RPA consultant? (59:17) - Does the RPA path require certification? (1:08:21) - Olaoluwa's Linkedin profile: https://www.linkedin.com/in/olaoluwa-daramola Subscribe to our newsletter: tinyletter.com/insidethetechos
I interview Al Sweigart, the author of Automate the Boring Stuff with Python and other fantastic Python books. You can get all of his books for free using the links below. Or you can buy the physical books. Learn about Python, Minecraft, Ciphers, Recursion, Python Gaming and a lot more with Al's fantastic books. And you can read them online for free :) // FREE Books // Free Python books: https://inventwithpython.com/ Automate the boring stuff free book: https://automatetheboringstuff.com/ // Physical Books // Buy books from Amazon: Automate the boring stuff with Python: https://amzn.to/3N2QuYu The big book of small Python projects: https://amzn.to/3xFJevS Coding with Minecraft: https://amzn.to/3Hx6bGh Cracking codes with Python: https://amzn.to/3zNhWXl The recursive book of recursion: https://amzn.to/3n0bJiV Invent your own computer games with Python: https://amzn.to/3bbGZZQ Beyond the basic stuff with Python: https://amzn.to/3badlUy Buy physical books from No Starch Press: https://nostarch.com/automatestuff2 // Al's SOCIAL // Twitter: https://twitter.com/AlSweigart YouTube: https://www.youtube.com/user/Albert10110 Udemy: https://www.udemy.com/course/automate/ // David's SOCIAL // Discord: https://discord.com/invite/usKSyzb Twitter: https://www.twitter.com/davidbombal Instagram: https://www.instagram.com/davidbombal LinkedIn: https://www.linkedin.com/in/davidbombal Facebook: https://www.facebook.com/davidbombal.co TikTok: http://tiktok.com/@davidbombal YouTube Main Channel: https://www.youtube.com/davidbombal YouTube Tech Channel: https://youtube.com/channel/UCZTIRrEN... YouTube Clips Channel: https://www.youtube.com/channel/UCbY5... YouTube Shorts Channel: https://www.youtube.com/channel/UCEyC... Apple Podcast: https://davidbombal.wiki/applepodcast Spotify Podcast: https://open.spotify.com/show/3f6k6gE... // MY STUFF // https://www.amazon.com/shop/davidbombal // SPONSORS // Interested in sponsoring my videos? Reach out to my team here: sponsors@davidbombal.com python minecraft python books best python books automate the boring stuff with python automate the boring stuff with python playlist the recursive book of recursion the big book of small python projects beyond the basic stuff with python coding with minecraft cracking cods with python invent your own computer games with python scratch 3 programming playground making games with python and pygame python for beginners python full course python tutorial python programming python projects python tutorial for beginners python interview questions python course python basics python for data science artificial intelligence machine learning python machine learning tutorial deep learning machine learning automate the boring stuff no starch press no starch press python Disclaimer: This video is for educational purposes only. Please note that the links listed may be affiliate links and provide me with a small percentage/kickback should you use them to purchase any of the items listed or recommended. Thank you for supporting me and this channel! #python #minecraft #hacking
Do you remember the One Laptop Per Child program? What went wrong, and what can we learn from the program's failure? What are the potential pitfalls of charismatic technology, and how can we avoid them when introducing students to programming? This week on the show, former guest Al Sweigart and author Morgan Ames are here to talk about her book "The Charisma Machine - The Life, Death, and Legacy of One Laptop per Child."
Are you a beginner or intermediate Python programmer who has made it through some of the fundamentals? Have you tried to tackle a big project but got stuck and frustrated? Completing some small projects might be the answer. This week on the show, we have author Al Sweigart and talk about his new book, "The Big Book of Small Python Projects."
Watch the live stream: Watch on YouTube About the show Sponsored by us: Check out the courses over at Talk Python And Brian's book too! Special guest: Al Sweigart Brain #1: just From a tweet by Jeff Triplett “just is a handy way to save and run project-specific commands. Commands, called recipes, are stored in a file called justfile with syntax inspired by make Just is a command runner, not a build system, so it avoids much of Make's complexity and idiosyncrasies. No need for .PHONY recipes! Linux, MacOS, and Windows are supported with no additional dependencies.” It's written in Rust. My favorite differences: a couple spaces is fine, no need for tabs Recipes can accept command line arguments Recipes can be listed from the command line. Recipes can be written in arbitrary languages, like Python hello: echo "Hello World!" pyhello: #!/usr/bin/env python3 print('Hello from python!') Michael #2: Strong Typing via Roman Right (Beanie) Decorator which checks whether the function is called with the correct type of parameters. Decorator which checks at Runtime whether the function is called with the correct type of parameters. Raises TypeMisMatch if the used parameters in a function call where invalid. Al #3: New book: “The Big Book of Small Python Projects” New book: “Beyond the Basic Stuff with Python” Brian #4: testbook Suggested by David Nicholson Write conventional unit tests for Jupyter Notebooks Execute all or some specific cells before unit test Share kernel context across multiple tests (using pytest fixtures) Support for patching objects Inject code into Jupyter notebooks Works with any unit testing library, unittest, pytest, etc. example foo.ipynb: def foo(a, b): return a + b test_foo.py: from testbook import testbook @testbook('foo.ipynb', execute=True) def test_foo(tb): foo = tb.ref("foo") assert foo(1, 2) == 3 Michael #5: auto-all Automatically manage the __all__ variable in Python modules. Easily populate the __all__ variable in modules. Easily exclude imported objects Clearly differentiate between internal and external facing objects. Use simple, intuitive code. Never worry about forgetting to add new objects to __all__. Help Python IDE's differentiate between internal and external facing objects. Can use “regions” via start_all() and end_all() I prefer the decorator (functions only, seems ripe for a PR for classes) @public def a_public_function(): pass Al #6: Next book: Untitled Recursion Book Extras Michael: OhMyPosh + auto env A scalable method of determining physiological endotypes of sleep apnea from a polysomnographic sleep study Email, inbox woes, and catching up Microsoft unveils Windows 365 Facebook and its advertisers are ‘panicking' as the majority of iPhone users opt out of tracking Al GitHub repo for PyAutoGUI
In this week’s show, Phil talks to Al Sweigart, a professional developer who teaches programming to kids and adults. As well as being a speaker at Python conferences, he has written several bestselling programming books for beginners, including ‘Automate the Boring Stuff with Python’, ‘Invent Your Own Computer Games with Python’, ‘Cracking Codes with Python’, and ‘Coding with Minecraft’. Al talks about the fact that many jobs are attainable, despite the job description and list of qualifications required. Never count yourself out of the race. He also discusses why coding itself can feel intimidating, but that it’s nothing to be feared. Show notes can be found at https://itcareerenergizer.com/e289
Sponsored by Datadog: pythonbytes.fm/datadog Special guest: Jeremy Tanner Watch on YouTube Brian #1: Constant Folding in Python Arpit Bhayani Constant Folding is when a language replaces constant expressions at compile time rather than computing them at runtime. CPython does this while creating the bytecode. We can use dis to see it in action >>> import dis >>> dis.dis("day_sec = 24 * 60 * 60") 1 0 LOAD_CONST 0 (86400) 2 STORE_NAME 0 (day_sec) 4 LOAD_CONST 1 (None) 6 RETURN_VALUE Python tries to fold lots of constants, but not all. Seems to be based on size >>> x = 2 ** 64 # folded >>> x = 4 ** 64 # not folded >>> a = "-" * 4096 # folded >>> a = "-" * 4097 # not folded Discussion continues with a discussion of how CPython folding is implemented recursively and elegantly. Key takeaway for me: Remember to not try to pre-compute constants while coding. Make them easy to read and Python will handle the optimization for you. Michael #2: Update All Packages With pip-review via PyCoders Updating Python packages can be a hassle. There are many of them - it's hard to keep track of all the newest versions When you decide what to update, you still have to update each of them manually. Originally a part of the pip-tools package, it now lives on as a standalone convenience wrapper around pip. Usage (venv) $ pip install pip-review (venv)$ pip-review scikit-learn==0.23.2 is available (you have 0.23.1) scipy==1.5.4 is available (you have 1.4.1) seaborn==0.11.0 is available (you have 0.10.1) ... Once you've identified if you'd like to update your packages, you can update them all, automatically, using pip-review --auto Limit with constraints.txt file Can do it interactively via pip-review --interactive Jeremy #3: Quantum Mechanical Keyboard Firmware How does the Python get into your computer? Much of it, through the keyboard Why mechanical keyboards? Ergonomics Where is QWERTY from? And when? Keymaps and because it’s essentially an escape room built of hardware and open source software and dodgy international transactions I’ve fallen further down the mechanical keyboard rabbit hole RGBKB Sol Keyboardio Atreus Keyboard firmware is mostly written in c https://github.com/qmk But there are Python portions https://github.com/qmk/qmk_cli Compiler helper API Reporting So the CLI is Python, where else is Python? When looking to improve your keymap, key logging w/ Python to process logs for heatmaps https://github.com/qmk/qmk_firmware/issues/714 https://github.com/algernon/ergodox-layout/blob/master/tools/log-to-heatmap.py Brian #4: Reinventing the Python Logo Carlo Occhiena interview with Jessica Williamson Some cool logo history Early logo Current, from 2006, designed by Tim Parklin “The logo is actually based on mayan representations of snakes which very often represent only the head and perhaps a short length of tail. The structure of the snake representations the natural coiling/nesting of a snake as seen side on.” - Tim Parklin Jessica Williamson proposed a new one in 2020: Then there’s the rest of the article talking about the design process, etc. But….. just wanted to throw this out there. I’m happy with the 2006 version. - Brian MK: Have you ever seen the logos on the app stores? Michael #5: Private PyPI with Serverless Computing Project: aws-lambda-pypi Brings together a few pieces so you can easily run a small PyPICloud instance as an AWS Lambda function with the help of Terraform. PyPICloud lets you publish Python packages privately. AWS Lambda lets you run a small service for free. Terraform ensures the service is deployed and maintained correctly. Security: This project takes the following security precautions. The session keys are auto-generated and stored in a secret. The server configuration file, which contains the session keys, is generated on the fly to minimize the possibility of exposure. The lambda function runs with a role limited to accessing only what it needs. PyPICloud is configured to display no packages to unauthenticated users. Jeremy #6: Beyond the Basic Stuff w/Python Al Sweigart Want to become less feral? Extras: Michael: Django 3.2 alpha 1 released mypy 0.800 with Python 3.9 Support pip 21.0 out and it drops Python 2 Elastic changes open-source license to monetize cloud-service use Brian: We talked about pip-chill in episode 208 pip-chill now has a --no-chill option to not list itself. Nice. I was just on https://www.twitch.tv/microsoftdeveloper, short, but fun Joke via Wolf by Kat Maddox developer: so i have good news and bad news manager: what's the good news? developer: i've discovered that the "5 second rule" only applies to food manager: and the bad news? developer: i dropped our tables
Joining Mark this week are:Scott BossmanMike ZainoErik PetersonTate LitchfieldScott ToddListen in as they go around the table and share with us a few of the goals they would like to achieve for the year 2021. From spending more time with family to cracking marketing codes, the Land Geeks have a lot in store. Tune in to hear more!TIP OF THE WEEKMark: My tip of the week is, I got Ready Player 2 by Ernest Cline, the book and an audible book. The way to really absorb it because there are so many references on it is to listen to it on 1.2x speed and read it at the same time. Be totally immersed in Ready Player 2.Erik: Check out this book on Amazon, automate the boring stuff with Python. It is a programming language, very simple to learn, it is not overly complex. This isn't like a quick-fix, this is not like a plug-in. This is like a long-term commitment, if you want to learn something that's kind of translate for a while and you want to learn computer programming, then check out Python on this book: Automate the Boring Stuff with Python by Al Sweigart.Are you ready to learn more about land investing? Just click HERE to schedule a call.Isn't it time to create passive income so you can work where you want, when you want and with whomever you want?
You probably have heard of the bestselling Python book, "Automate the Boring Stuff with Python." What are the next steps after starting to dabble in the Python basics? Maybe you've completed some tutorials, created a few scripts, and automated repetitive tasks in your life. This week on the show, we have author Al Sweigart to talk about his new book, "Beyond the Basic Stuff with Python: Best Practices for Writing Clean Code."
Sponsored by DataDog: pythonbytes.fm/datadog Special guest: Aly Aly #1: Andrew Godwin - Just Add Await: Retrofitting Async into Django — DjangoCon 2019 Andrew is leading the implementation of asynchronous support for Django Overview of Async Landscape How synchronous and asynchronous code interact Async functions are different than sync functions which makes it hard to design APIs Difficulties in adding Async support to Django Django is a project that a lot of people are familiar with; it’s new async implementation also needs to feel familiar Plan was Implement async capabilities in three phases Phase 1: ASGI Support (Django 3.0) This phase lays the groundwork for future changes ORM is async-aware: using it from async code raises a SynchronousOnlyOperation exception Phase 2: Async Views, Async Handlers, and Async Middleware (Django 3.1) Add async capabilities for the core part of the request path There is a branch where things are mostly working, just need to fix a couple of tests Phase 3: Async ORM (Django 3.2 / 4.0) Largest, most difficult and most unbounded part of the project ORM queries can result in lots of database lookups; have to be careful here Async Project Wiki - project status, find out how to contribute Brian #2: gamesbyexample Al Sweigart “PythonStdioGames : A collection of games (with source code) to use for example programming lessons. Written in Python 3. Click on the src folder to view all of the programs.” I first learned programming by modifying games written by others and seeing what the different parts do when I change them. For me it was Lunar Lander on a TRS-80, and it took forever to type in the listing from the back of a magazine. But now, you can just clone a repo and play with existing files. Cool features: They're short, with a limit of 256 lines of code. They fit into a single source code file and have no installer. They only use the Python standard library. They only use stdio text; print() and input() in Python. They're well commented. They use as few programming concepts as possible. If classes, list comprehensions, recursion, aren't necessary for the program, then they are't used. Elegant and efficient code is worthless next to code that is easy to understand and readable. These programs are for education, not production. Standard best practices, like not using global variables, can be ignored to make it easier to understand. They do input validation and are bug free. All functions have docstrings. There’s also a todo list if people want to help out. Aly #3: Bulwark Open-source library that allows users to property test pandas DataFrames Goal is to make it easy for data analysts and data scientists to write tests Tests around data are different; they are not deterministic, they requires us to think about testing in a different way With property tests, we can check an object has a certain property Property tests for DataFrames includes validating the shape of the DataFrame, checking that a column is within a certain range, verifying a DataFrame has no NaNs, etc Bulwark allows you to implement property tests as checks. Each check Takes a DataFrame and optional arguments The check will make an assertion about a DataFrame property If the assertion passes, the check will return the original, unaltered DataFrame If the check fails, an AssertionError is raised and you have context around why it failed Bulwark also allows you to implement property checks as decorators This is useful if you design data pipelines as functions Each function take in input data, performs an action, returns output Add decorators validate properties of input DataFrame to pipeline functions Lots of builtin checks and decorators; easy to add your own Slides with example usage and tips: Property Testing with Pandas with Bulwark Brian #4: Poetry 1.0.0 Sebastien Eustace caution: not backwards compatible full change log Highlights: Poetry is getting serious. more ways to manage environments switch between python versions in a project with poetry env use /path/to/python or poetry env use python3.7 Imroved support for private indices (instead of just pypi) can specify index per dependency can specify a secondary index can specify a non-pypi index as default, avoiding pypi Env variable support to more easily work with poetry in a CI environment Improved add command to allow for constraints, paths, directories, etc for a dependency publishing allows api tokens marker specifiers on dependencies. Aly #5: Kubernetes for Full-Stack Developers With the rise of containers, Kubenetes has become the defacto platform for running and coordinating containerized applications across multiple machines With the rise of containers, Kubenetes is the defacto platform for running and coordinating applications across multiple machines This guide follows steps new users would take when learning how to deploy applications to Kubernetes: Learn Kubernetes core concepts Build modern 12 Factor web applications Get applications working inside of containers Deploy applications to Kubernetes Manage cluster operations New to containers? Check out my Introduction to Docker talk Brian #6: testmon: selects tests affected by changed files and methods On a previous episode (159) we mentioned pytest-picked and I incorrectly assumed it would run tests related to code that has changed, ‘cause it says “Run the tests related to the unstaged files or the current branch (according to Git)”. I was wrong, Michael was right. It runs the tests that are in modified test files. What I was thinking of is “testmon” which does what I was hoping for. “pytest-testmon is a pytest plugin which selects and executes only tests you need to run. It does this by collecting dependencies between tests and all executed code (internally using Coverage.py) and comparing the dependencies against changes. testmon updates its database on each test execution, so it works independently of version control.” If you had tried testmon before, like me, be aware that there have been significant changes in 1.0.0 Very cool to see continued effort on this project. Extras: Aly: Finding local Python User Groups PyCon.org Events Calendar Meetup.com search for Python PyTennessee 2019 on March 7 - 8. Tickets on sale now! I will be giving a talk on the Facade Design Pattern Brian: Next episode is planned to be a live recording during the Jan 7 Python PDX West meetup. There will also be 1-2 other talks. Joke: From Tyler Matteson Two coroutines walk into a bar. RuntimeError: 'bar' was never awaited. From Ben Sandofsky Q: How many developers on a message board does it take to screw in a light bulb? A: “Why are you trying to do that?”
Sponsored by DigitalOcean: pythonbytes.fm/digitalocean Brian #1: Type Hints for Busy Python Programmers Al Sweigart, @AlSweigart We’ve (Michael and myself, of course) convinced you that type hints might be a good thing to help reduce bugs or confusion or whatever. Now what? Al’s got your back with this no nonsense guide to get you going very quickly. Written as a conversation between a programmer and an type hint expert. Super short. Super helpful. typing and mypy are the modules you need. There are other tools, but let’s start there. Doesn’t affect run time, so you gotta run the tool. Gradually add, don’t have to do everything in one go. Covers the basics And then the “just after basics” stuff you’ll run into right away when you start, like: Allowing a type and None: Union[int, NoneType] Optional parameters Shout out to Callable, Sequence, Mapping, Iterable, available in the documentation when you are ready for them later Just really a great get started today guide. Michael #2: auto-py-to-exe A .py to .exe converter using a simple graphical interface built using Eel and PyInstaller in Python. Using the Application Select your script location (paste in or use a file explorer) Outline will become blue when file exists Select other options and add things like an icon or other files Click the big blue button at the bottom to convert Find your converted files in /output when complete Short 3 min video. Brian #3: How to document Python code with Sphinx Moshe Zadka, @moshezadka I’m intimidated by sphinx. Not sure why. But what I’ve really just wanted to do is to use it for this use of generating documentation of code based on the code and the docstrings. Many of the tutorials I’ve looked at before got me stuck somewhere along the way and I’ve given up. But this looks promising. Example module with docstring shown. Simple docs/index.rst, no previous knowledge of restructured text necessary. Specifically what extensions do I need: autodoc, napolean, and viewcode example docs/conf.py that’s really short setting up tox to generate the docs and the magic command like incantation necessary: sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html That’s it. (well, you may want to host the output somewhere, but I can figure that out. ) Super simple. Awesome Michael #4: Snek is a cross-platform PowerShell module for integrating with Python via Chad Miars Snek is a cross-platform PowerShell module for integrating with Python. It uses the Python for .NET library to load the Python runtime directly into PowerShell. Using the dynamic language runtime, it can then invoke Python scripts and modules and return the result directly to PowerShell as managed .NET objects. Kind of funky syntax, but that’s PowerShell for you ;) Even allows for external packages installed via pip Brian #5:How to use Pandas to access databases Irina Truong, @irinatruong You can use pandas and sqlalchemy to easily slurp tables right out of your db into memory. But don’t. pandas isn’t lazy and reads everything, even the stuff you don’t need. This article has tips on how to do it right. Recommendation to use the CLI for exploring, then shift to pandas and sqlalchemy. Tips (with examples, not shown here): limit the fields to just those you care about limit the number of records with limit or by selecting only rows where a particular field is a specific value, or something. Let the database do joins, even though you can do it in pandas Estimate memory usage with small queries and .memory_usage().sum(). Tips on reading chunks and converting small int types into small pandas types instead of 64 bit types. Michael #6: ijson — Iterative JSON parser with a standard Python iterator interface Iterative JSON parser with a standard Python iterator interface Most common usage is having ijson yield native Python objects out of a JSON stream located under a prefix. Here’s how to process all European cities: // from: { "earth": { "europe": [ ... ] } } stream each entry in europe as item: objects = ijson.items(f, 'earth.europe.item') cities = (o for o in objects if o['type'] == 'city') for city in cities: do_something_with(city) Extras: Michael: Python decision makers webcast on January 14th, 9:30am US Pacific Guido steps down from Steering Council via Vincent POULAILLEAU GitHub Archive Program, Preserving open source software for future generations, video Python 2.7 will be removed from Homebrew, via Allan Hansen Django 3.0 released Joke: Question: "What is the best prefix for global variables?" Answer: # via shinjitsu A web developer walks into a restaurant. He immediately leaves in disgust as the restaurant was laid out in tables. via shinjitsu
Isn't it surprising how much repetition goes into the job of teaching? What if you could use Python to automate that and focus on the work that adds the most value for your students? Or at least eliminate the boring teaching stuff like transferring grades or setting up iPads. With thanks to Al Sweigart and his book, Automate the Boring Stuff With Python (https://automatetheboringstuff.com/), Kelly and Sean look at how teachers can leverage Python to speed up or eliminate the most boring and repetitive aspects of teaching. This episode includes a walkthrough of an example project that Sean built to automate iPad setup at his school using Google Cloud Functions (https://cloud.google.com/functions/), JAMF Server APIs (https://www.jamf.com), and Apple Device Management (https://developer.apple.com/documentation/devicemanagement).
Chris Williams kicks off the Python 4 DevOps series discussing the basics Resources: Automate the Boring Stuff by Al Sweigart https://www.twitter.com/AlSweigart Modern Python 3 Bootcamp (Colt Steele) - Udemy Python for Everybody - py4e.com https://www.twitter.com/drchuck Python Crash Course (Eric Matthes) https://www.twitter.com/ehmatthes https://www.codecombat.com docs.python.org/3/tutorial wiki.python.org/main/BeginnersGuide/NonProgrammers Talk Python to Me podcast https://www.twitter.com/mkennedy pythontutor.com
Episode 8: 1. Code [dot] org for K - 12, free computer science lessons & online coding labs. 2. Invent with Python [dot] com author & coder Al Sweigart's website, free online versions of his published books. 3. Python [dot] org the Pythonista mothership. Download (for free) the latest version of Python for Windows, Mac OS, or Linux. 4. CS First [dot] with Google [dot] com Google's free computer science curriculum for kids (9 - 14). CS First with Scratch 3.0 launches on Jan. 2, 2019. Next episode: What Should a CFK (Coding For Kids) Curriculum Look Like. Web pythonfumasters.com | Facebook @pythonfumasters | Instagram @masterhun
Es gibt einen neuen deutschsprachigen Python-Podcast. Zunächst hatten wir vor, einen anderen Namen zu verwenden, aber den fanden wir dann doch irgendwie doof. Und auf der Suche nach einer Domain fiel uns auf, dass python-podcast.de noch frei war. Gut, dann wird das eben nicht ein sondern der neue Python-Podcast :), dessen erste Folge wir vor Kurzem aufgenommen haben! Wir - das sind Dominik und Jochen. In der ersten Sendung erzählen wir ein wenig über uns und unseren Weg zu Python. Danach geben wir einen kurzen Überblick über die Geschichte, Gegenwart und Zukunft von Python, um dann hemmungslos in alle möglichen Richtungen abzuschweifen. Shownotes Unsere E-Mail für Fragen, Anregungen & Kommentare: hallo@python-podcast.de Python-Download Offizielle Dokumentation Interview mit Guido van Rossum über die Geschichte von Python in der Episode #100 von TalkPythonToMe (englischsprachig) Empfohlene Tutorials: Learn Python the Hard Way | Zed A. Shaw Automate the Boring Stuff with Python | Al Sweigart Dan Bader veröffentlicht regelmäßig tolle Artikel & Tutorials auf RealPython.com Es gibt für Python unzählige andere - auch kostenlose - Tutorials, einfach mal die Suchmaschine anschmeißen 8-)
We got the opportunity to speak with Al Sweigart about his work on books like ‘Automate The Boring Stuff With Python' and ‘Invent With Python'. We discussed how Python can be useful to people who don't work as software engineers, why coding literacy is important for the general populace and how that will affect the ways in which we interact with software.
TestTalks | Automation Awesomeness | Helping YOU Succeed with Test Automation
In this episode, Al Sweigart shares how easy it is for someone with little-to-no programming experience can get started automating some of the most boring tasks that fill our days. Whats great about this is you'll find automation can be used for much more than your typical end-to-end functional testing scenarios. So if you've struggled in the past to learn a programming language for test automation, today you're going to discover it's much easier to get started than you probably think.