POPULARITY
What is error culture, and how do you avoid it within your organization? How do you navigate alert and notification fatigue? Hey, it's episode #200! Real Python's editor-in-chief, Dan Bader, joins us this week to celebrate. Christopher Trudeau also returns to bring another batch of PyCoder's Weekly articles and projects.
⚡ [FREE] Social Media Mastery Awaits! Get Your Hands on Our Free One-Month Ebook ⚡
Watch the live stream: Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Special guest: Ashley Anderson Ashley #1: PSF security key giveaway for critical package maintainers Giving away 4000 2FA hardware keys Surely a team effort but I found it via @di_codes twitter (Dustin Ingram) links to previous talks on PyPI/supply chain security Interesting idea for helping with supply-chain vulnerabilities At least one dev pulled a critical package in response Previously: I don't have any critical projects Armin Ronacher has an interesting take Michael #2: PyLeft-Pad via Dan Bader Markus Unterwaditzer was maintaining atomicwrites More on how this relates to a project (Home Assistant) I wonder if PyPI will become immutable once an item is published Brian #3: FastAPI Filter Suggested and created by Arthur Rio “I loved using django-filter with DRF and wanted an equivalent for FastAPI.” - Arthur Add query string filters to your api endpoints and show them in the swagger UI. Supports SQLAlchemy and MongoEngine. Supports operators: gt, gte, in, isnull, it, lte, not/ne, not_in/nin Ashley #4: Tools for building Python extensions in Rust PyO3 pyo3 - Python/Rust FFI bindings nice list of examples people might recognize in the PyO3 README Pydantic V2 will use it for pydantic-core maturin - PEP 621 wheel builder (pyproject.toml) pretty light weight, feels like flit for Rust or python/Rust rust-numpy (+ndarray) for scientific computing setuptools-rust for integrating with existing Python projects using setuptools Rust project and community place high value on good tooling, relatively young language/community with a coherent story from early on Rust macro system allows for really nice ergonomics (writing macros is very hard, using them is very easy) The performance/safety/simplicity tradeoffs Python and Rust make are very different, but both really appeal to me - Michael #5: AutoRegEx via Jason Washburn Enter an english phrase, it'll try to generate a regex for you You can do the reverse too, explain a regex You must sign in and are limited to 100 queries / [some time frame] Related from Simon Willison: Using GPT-3 to explain how code works Brian #6: Anaconda Acquires PythonAnywhere Suggested by Filip Łajszczak See also Anaconda Acquisition FAQs from PythonAnywhere blog From announcement: “The acquisition comes on the heels of Anaconda's release of PyScript, an open-source framework running Python applications within the HTML environment. The PythonAnywhere acquisition and the development of PyScript are central to Anaconda's focus on democratizing Python and data science.” My take: We don't hear a lot about PA much, even their own blog has had 3 posts in 2022, including the acquisition announcement. Their home page boasts “Python versions 2.7, 3.5, 3.6, 3.7 and 3.8”, although I think they support 3.9 as well, but not 3.10 yet, seems like from the forum. Also, no ASGI, so FastAPI won't work, for example. Still, I think PA is a cool idea, and I'd like to see it stay around, and stay up to date. Hopefully this acquisition is the shot in the arm it needed. Extras Michael: Python becomes the most sought after for employers hiring (by some metric) Ashley: PEP691 JSON Simple API for PyPI Rich Codex - automatic terminal “screenshots” Joke: Neta is a programmer
Watch the live stream: Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training Test & Code Podcast Patreon Supporters Michael #1: auto-py-to-exe Converts .py to .exe using a simple graphical interface A good candidate to install via pipx For me, just point it at the top level app.py file and click go Can add icons, etc. Got a .app version and CLI version (I think
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: Leah Cole Brian #1: pytest 7.0.0rc1 Question: Does the new pytest book work with pytest 7? Answer: Yes! I've been working with pytest 7 during final review of all code, and many pytest core developers have been technical reviewers of the book. A few changes in pytest 7 are also the result of me writing the 2nd edition and suggesting (and in one case implementing) improvements. Florian Bruhin's announcement on Twitter “I'm happy to announce that I just released #pytest 7.0.0rc1! After many tricky deprecations, some internal changes, and months of delay due to various issues, it looks like we could finally get a new non-bugfix release this year! (6.2.0 was released in December 2020).” “We invite everyone to test the #pytest prerelease and report any issues - there is a lot that happened, and chances are we broke something we didn't find yet (we broke a lot of stuff we already fixed Smiling face with open mouth and cold sweat). See the release announcement for details: https://docs.pytest.org/en/7.0.x/announce/release-7.0.0rc1.html” Try it out with pip install pytest==7.0.0rc1 For those of you following along at home (we covered pip index briefly in episode 259) to see rc releases with pip index versions, add --pre ex: pip index versions --``pre pytest will include Available versions: 7.0.0rc1, 6.2.5, 6.2.4, and let you know if there's a newer rc available. Highlights from the 7.0.0rc1 changelog pytest.approx() now works on Decimal within mappings/dicts and sequences/lists. Improvements to approx() with sequences of numbers. Example: > assert [1, 2, 3, 4] == pytest.approx([1, 3, 3, 5]) E assert comparison failed for 2 values: E Index | Obtained | Expected E 1 | 2 | 3 +- 3.0e-06 E 3 | 4 | 5 +- 5.0e-06 pytest invocations with --fixtures-per-test and --fixtures have been enriched with: Fixture location path printed with the fixture name. First section of the fixture's docstring printed under the fixture name. Whole of fixture's docstring printed under the fixture name using --verbose option. Never again wonder where a fixture's definition is RunResult method assert_outcomes now accepts a warnings and deselected argument to assert the total number of warnings captured. Helpful for plugin testing. Added pythonpath setting that adds listed paths to sys.path for the duration of the test session. Nice for using pytest for applications, and for including test helper libraries. Improved documentation, including an auto-generated list of plugins. There were 963 this morning. Michael #2: PandasTutor via David Smit Why use this tool? Let's say you're trying to explain what this pandas code does: (dogs[dogs['size'] == 'medium'] .sort_values('type') .groupby('type').median() ) But this doesn't tell you what's going on behind the scenes. What did this code just do? This single code expression has 4 steps (filtering, sorting, grouping, and aggregating), but only the final output is shown. Where were the medium-sized dogs? This code filters for dogs with size "medium", but none of those dogs appear in the original table display (on the left) because they were buried in the middle rows. How were the rows grouped? The output doesn't show which rows were grouped and aggregated together. (Note that printing a pandas.GroupBy object won't display this information either.) If you ran this same code in Pandas Tutor, you can teach students exactly what's going on step-by-step Leah #3: Apache Airflow Workflow orchestration tool the originated at Airbnb and is now part of the Apache Software Foundation author workflows as directed acyclic graphs (DAGs) of tasks Airflow works best with workflows that are mostly static and slowly changing. When DAG structure is similar from one run to the next, it allows for clarity around unit of work and continuity. Typical data analytics workflow is the Extract, Transform, Load (ETL) workflow - I have data somewhere that I need to get (extract), I do something to it (Transform) and I put that result somewhere else (load) Airflow has "Operators" and connectors which enable you to perform common tasks in popular libraries and Cloud providers Let's talk about a sample - I work on GCP so my sample will be GCP based because that's what I use most. One common workflow I see is running Spark jobs in ephemeral Dataproc clusters. I'm actually writing a tutorial demonstrating this now - literally in progress in another tab BigQuery -> Create Dataproc cluster -> Run PySpark Dataproc job -> Store results in GCS -> delete Dataproc cluster Airflow has a really wonderful, active community. Please join us. Brian #4: textwrap.dedent Suggested by Michel Rogers-Vallée Small utility but super useful. Also, built in to Python standard library. BTW, textwrap package has other cool tools you probably didn't know Python could do right out of the box. It's worth reading the docs. dedent akes a multiline string (the ones with tripple quotes). Removes all common whitespace. This allows you to have multi-line strings defined in functions without mucking up your indenting. Example from docs: def test(): # end first line with to avoid the empty line! s = ''' hello world ''' print(repr(s)) # prints ' hellon worldn ' print(repr(dedent(s))) # prints 'hellon worldn' Better example: from textwrap import dedent def multiline_hello_world(): print("hello") print(" world") def test_multiline_hello_world(capsys): expected = dedent(''' hello world ''') multiline_hello_world() actual = capsys.readouterr().out assert actual == expected Michael #5: pip-audit via Dan Bader (from Real Python) Audits Python environments and dependency trees for known vulnerabilities Are your dependencies containing security issues? What about their dependencies, the ones you forgot to list in your requirements files or pin? Just run pip-audit on your requirements file(s) Perfect candidate for pipx Leah #6 - Using bots to manage samples Another part of my job is working with other software engineers in GCP to oversee the maintenance our Python samples We have thousands of samples in hundreds of repos that are part of GCP documentation To ensure consistency and that this wonderful group of Devrel Engineers has time to get their work done and also function as a human, we use a lot of automation Bots do things like keep our dependencies up to date, check for license headers, auto-assign PRs and issues to code-owners, sync repositories with a centralized config, and more the GCP DevRel github automation team has an open source repo with some of the bots they have developed that we use every day and we use whitesource renovatebot to manage our dependencies and keep them up to date Extras Michael: Github CMD/CTRL+K command palette Python 3.10.1 is out Joke: HTTP status code meanings http.cat
In this episode of Campus Beat, we welcome Dan Bader, President and CEO of Bader Philanthropies Inc. On the occasion of celebrating the newly proclaimed Bader Day on November 15th, Dan talks about his father, Dr. Alfred Bader’s, extraordinary journey to Queen’s University where he began his studies on November 15th, 1941. Dan also shares […]
If you haven't visited the website lately, then you're missing out on the updates to realpython.com! The site features a completely refreshed layout with multiple sections to help you take advantage of even more great educational Python content. This week on the show, we have Dan Bader, the person behind Real Python, and all these architectural changes.
Sponsored by Datadog: pythonbytes.fm/datadog Special guest: Hannah Stepanek Watch on YouTube Michael #1: We Downloaded 10,000,000 Jupyter Notebooks From Github – This Is What We Learned by Alena Guzharina from JetBrains Used the hundreds of thousands of publicly accessible repos on GitHub to learn more about the current state of data science. I think it’s inspired by work showcased here on Talk Python. 2 years ago there were 1,230,000 Jupyter Notebooks published on GitHub. By October 2020 this number had grown 8 times, and we were able to download 9,720,000 notebooks. 8x growth. Despite the rapid growth in popularity of R and Julia in recent years, Python still remains the most commonly used language for writing code in Jupyter Notebooks by an enormous margin. Python 2 went from 53% → 11% in the last two years. Interesting graphs about package usage Not all notebooks are story telling with code: 50% of notebooks contain fewer than 4 Markdown cells and more than 66 code cells. Although there are some outliers, like notebooks with more than 25,000 code lines, 95% of the notebooks contain less than 465 lines of code. Brian #2: pytest-pythonpath plugin for adding to the PYTHONPATH from the pytests.ini file before tests run Mentioned briefly in episode 62 as a temporary stopgap until you set up a proper package install for your code. (cringing at my arrogance). Lots of projects are NOT packages. For example, applications. I’ve been working with more and more people to get started on testing and the first thing that often comes up is “My tests can’t see my code. Please fix.” Example proj/src/stuff_you_want_to_test.py proj/tests/test_code.py You can’t import stuff_you_want_to_test.py from the proj/tests directory by default. The more I look at the problem, the more I appreciate the simplicity of pytest-pythonpath pytest-pythonpath does one thing I really care about: Add this to a pytest.ini file at the proj level: [pytest] python_paths = src That’s it. That’s all you have to do to fix the above problem. Paths relative to the directory that pytest.ini is in. Which should be a parent or grandparent of the tests directory. I really can’t think of a simpler way for people to get around this problem. Hannah #3: Thinking in Pandas Pandas dependency hierarchy (simplified): Pandas -> NumPy -> BLAS (Basic Linear Algebra Subprograms) Languages: - - Python -> C -> Assembly df["C"] = df["A"] + df["B"] A = [ 1 4 2 0 ] B = [ 3 2 5 1 ] C = [ 1 + 3 4 + 2 2 + 5 0 + 1 ] Pandas tries to get the best performance by running operations in parallel. You might think we could speed this problem up by doing something like this: Thread 1: 1 + 3 Thread 2: 4 + 2 Thread 3: 2 + 5 Thread 4: 0 + 1 However, the GIL (Global Interpreter Lock) prevents us from achieving the performance improvement we are hoping for. Below is an example of a common threading problem and how a lock solves that problem. - Thread 1 total Thread 2 1 + 3 + 4 + 2 0 0 + 5 10 0 + 6 + 2 total += 10 0 13 total =10 0 total += 13 10 total = 13 13 Thread 1 total Thread 2 1 + 3 + 4 + 2 0 unlocked 0 + 5 10 0 unlocked + 6 + 2 total += 10 0 locked 13 total =10 0 locked 10 unlocked 10 locked total += 13 10 locked total = 13 23 unlocked As it turns out, because Python manages memory for you every object in Python would be subject to these kinds of threading issues: a = 1 # reference count = 1 b = a # reference count = 2 del(b) # reference count = 1 del(a) # reference count = 0 So, the GIL was invented to avoid this headache which only lets one thread run at a time. Certain parts of the Pandas dependency hierarchy are not subject to the GIL (simplified): Pandas -> NumPy -> BLAS (Basic Linear Algebra Subprograms) GIL -> no GIL -> hardware optimizations So we can get around the GIL in C land but what kind of optimizations does BLAS provide us with? Parallel operations inside the CPU via Vector registers A vector register is like a regular register but instead of holding one value it can hold multiple values. | 1 | 4 | 2 | 0 | + + + + | 3 | 2 | 5 | 1 | = = = = | 4 | 6 | 7 | 1 | Vector registers are only so large though, so the Dataframe is broken up into chunks and the vector operations are performed on each chunk. Michael #4: Quickle Fast. Benchmarks show it’s among the fastest serialization methods for Python. Safe. Unlike pickle, deserializing a user provided message doesn’t allow for arbitrary code execution. Flexible. Unlike msgpack or json, Quickle natively supports a wide range of Python builtin types. Versioning. Quickle supports “schema evolution”. Messages can be sent between clients with different schemas without error. Example >>> import quickle >>> data = quickle.dumps({"hello": "world"}) >>> quickle.loads(data) {'hello': 'world'} Brian #5: what(), why(), where(), explain(), more() from friendly-traceback console Do this: $ pip install friendly-friendly_traceback.install() $ python -i >>> import friendly_traceback >>> friendly_traceback.start_console() >>> Now, after an exception happens, you can ask questions about it. >>> pass = 1 Traceback (most recent call last): File "[HTML_REMOVED]", line 1 pass = 1 ^ SyntaxError: invalid syntax >>> what() SyntaxError: invalid syntax A `SyntaxError` occurs when Python cannot understand your code. >>> why() You were trying to assign a value to the Python keyword `pass`. This is not allowed. >>> where() Python could not understand the code in the file '[HTML_REMOVED]' beyond the location indicated by --> and ^. -->1: pass = 1 ^ Cool for teaching or learning. Hannah #6: Bandit Bandit is a static analysis security tool. It’s like a linter but for security issues. pip install bandit bandit -r . I prefer to run it in a git pre-commit hook: # .pre-commit-config.yaml repos: repo: https://github.com/PyCQA/bandit rev: '1.7.6' hooks: - id: bandit It finds issues like: flask_debug_true request_with_no_cert_validation You can ignore certain issues just like any other linter: assert len(foo) == 1 # nosec Extras: Brian: Meetups this week 2/3 done. NOAA Tuesday, Aberdeen this morning - “pytest Fixtures” PDX West tomorrow - Michael Presenting “Python Memory Deep Dive” Updated my training page, testandcode.com/training Feedback welcome. I really like working directly with teams and now that trainings can be virtual, a couple half days is super easy to do. Michael: PEP 634 -- Structural Pattern Matching: Specification accepted in 3.10 PyCon registration open Python Web Conf reg open Hour of code - minecraft Joke: Sent in via Michel Rogers-Vallée, Dan Bader, and Allan Mcelroy. :) PEP 8 Song Watch on YouTube By Leon Sandoy and team at Python Discord
Sponsored by Datadog: pythonbytes.fm/datadog Michael #1: PSF / JetBrains Survey via Jose Nario Let’s talk results: 84% of people who use Python do so as their primary language [unchanged] Other languages: JavaScript (down), Bash (down), HTML (down), C++ (down) Web vs Data Science languages: More C++ / Java / R / C# on Data Science side More SQL / JavaScript / HTML Why do you mainly use Python? 58% work and personal What do you use Python for? Average answers was 3.9 Data analysis [59% / 59% — now vs. last year] Web Development [51% / 55%] ML [40% / 39%] DevOps [39% / 43%] What do you use Python for the most? Web [28% / 29%] Data analysis [18% / 17%] Machine Learning [13% / 11%] Python 3 vs Python 2: 90% Python 3, 10% Python 2 Widest disparity of versions (pro 3) is in data science. Web Frameworks: Flask [48%] Django [44%] Data Science NumPy 63% Pandas 55% Matplotlib 46% Testing pytest 49% unittest 30% none 34% Cloud AWS 55% Google 33% DigitalOcean 22% Heroku 20% Azure 19% How do you run code in the cloud (in the production environment) Containers 47% VMs 46% PAAS 25% Editors PyCharm 33% VS Code 24% Vim 9% tool use version control 90% write tests 80% code linting 80% use type hints 65% code coverage 52% Brian #2: Hypermodern Python Claudio Jolowicz, @cjolowicz An opinionated and fun tour of Python development practices. Chapter 1: Setup Setup a project with pyenv and Poetry, src layout, virtual environments, dependency management, click for CLI, using requests for a REST API. Chapter 2: Testing Unit testing with pytest, using coverage.py, nox for automation, pytest-mock. Plus refactoring, handling exceptions, fakes, end-to-end testing opinions. Chapter 3: Linting Flake8, Black, import-order, bugbear, bandit, Safety. Plus more on managing dependencies, and using pre-commit for git hooks. Chapter 4: Typing mypy and pytype, adding annotations, data validation with Desert & Marshmallow, Typeguard, flake8-annotations, adding checks to test suite Chapter 5: Documentation docstrings, linting docstrings, docstrings in nox sessions and test suites, darglint, xdoctest, Sphinx, reStructuredText, and autodoc Chapter 6: CI/CD CI with GithHub Actions, reporting coverage with Codecov, uploading to PyPI, Release Drafter for release documentation, single-sourcing the package version, using TestPyPI, docs on RTD The series is worth it even for just the artwork. Lots of fun tools to try, lots to learn. Michael #3: Open AI Jukebox via Dan Bader Listen to the songs under “Curated samples.” A neural net that generates music, including rudimentary singing, as raw audio in a variety of genres and artist styles. Code is available on github. Dataset: To train this model, we crawled the web to curate a new dataset of 1.2 million songs (600,000 of which are in English), paired with the corresponding lyrics and metadata from LyricWiki. The top-level transformer is trained on the task of predicting compressed audio tokens. We can provide additional information, such as the artist and genre for each song. Two advantages: first, it reduces the entropy of the audio prediction, so the model is able to achieve better quality in any particular style; second, at generation time, we are able to steer the model to generate in a style of our choosing. Brian #4: The Curious Case of Python's Context Manager Redowan Delowar, @rednafi A quick tour of context managers that goes deeper than most introducitons. Writing custom context managers with __init__, __enter__, __exit__. Using the decorator contextlib.contextmanager Then it gets even more fun Context managers as decorators Nesting contexts within one with statement. Combining context managers into new ones Examples Context managers for SQLAlchemy sessions Context managers for exception handling Persistent parameters across http requests Michael #5: nbstripout via Clément Robert In the latest episode, you praised NBDev for having a git hook that strips out notebook outputs. strip output from Jupyter and IPython notebooks Opens a notebook, strips its output, and writes the outputless version to the original file. Useful mainly as a git filter or pre-commit hook for users who don’t want to track output in VCS. This does mostly the same thing as the Clear All Output command in the notebook UI. Has a nice youtube tutorial right in the pypi listing Just do nbstripout --``install in a git repo! Brian #6: Write ups for The 2020 Python Language Summit Guido talked about this in episode 179 But these write-ups are excellent and really interesting. Should All Strings Become f-strings?, Eric V. Smith Replacing CPython’s Parser with a PEG-based parser, Pablo Galindo, Lysandros Nikolaou, Guido van Rossum A Formal Specification for the (C)Python Virtual Machine, Mark Shannon HPy: a Future-Proof Way of Extending Python?, Antonio Cuni CPython Documentation: The Next 5 Years, Carol Willing, Ned Batchelder Lightning talks (pre-selected) What do you need from pip, PyPI, and packaging?, Sumana Harihareswara A Retrospective on My "Multi-Core Python" Project, Eric Snow The Path Forward for Typing, Guido van Rossum Property-Based Testing for Python Builtins and the Standard Library, Zac Hatfield-Dodds Core Workflow Updates, Mariatta Wijaya CPython on Mobile Platforms, Russell Keith-Magee Wanted to bring this up because Python is a living language and it’s important to pay attention and get involved, or at least pay attention to where Python might be going. Also, another way to get involved is to become a member of the PSF board of directors What’s a PSF board of directors member do? video There are some open seats, Nominations are open until May 31 Extras: Michael: Updated search engine for better result ranking Windel Bouwman wrote a nice little script for speedscope https://github.com/windelbouwman/pyspeedscope (follow up from Austin profiler) Jokes: “Due to social distancing, I wonder how many projects are migrating to UDP and away from TLS to avoid all the handshakes?” - From Sviatoslav Sydorenko “A chef and a vagrant walk into a bar. Within a few seconds, it was identical to the last bar they went to.” - From Benjamin Jones, crediting @lufcraft Understanding both of these jokes is left as an exercise for the reader.
Sponsored by DigitalOcean: pythonbytes.fm/digitalocean Michael #1: Python in Production Hynek Missing a key part from the public Python discourse and I would like to help to change that. Hynek was listening to a podcast about running Python services in production. Disagreed with some of the choices they made, it acutely reminded me about what I’ve been missing in the past years from the public Python discourse. And yet despite the fact that the details aren’t relevant to me, the mindsets, thought processes, and stories around it captivated me and I happily listened to it on my vacation. Python conferences were a lot more like this. I remember startups and established companies alike to talk about running Python in production, lessons learned, and so on. (Instagram and to a certain degree Spotify being notable exceptions) An Offer: So in a completely egoistical move, I would like to encourage people who do interesting stuff with Python to run websites or some kind of web and network services to tell us about it at PyCons, meetups, and in blogs. Dan Bader and I covered this back on Talk Python, episode 215. Brian #2: How to cheat at unit tests with pytest and Black Simon Willison Premise: “In pure test-driven development you write the tests first, and don’t start on the implementation until you’ve watched them fail.” too slow, so …, “cheat” write a pytest test that calls the function you are working on and compares the return value to something obviously wrong. when it fails, copy the actual output and paste it into your test now it should pass run black to reformat the huge return value to something manageable Brian’s comments: That’s turning exploratory and manual testing into automated regression tests, not cheating. There is no “pure test-driven development”, we still can’t agree on what a unit is or if mocks are good or evil. Michael #3: Goodbye Microservices: From 100s of problem children to 1 superstar Retrospective by Alexandra Noonan Javascript but the lessons are cross language Microservices is the architecture du jour Segment adopted this as a best practice early-on, which served us well in some cases, and, as you’ll soon learn, not so well in others. Microservices is a service-oriented software architecture in which server-side applications are constructed by combining many single-purpose, low-footprint network services. Touted benefits are improved modularity, reduced testing burden, better functional composition, environmental isolation, and development team autonomy. Instead of enabling us to move faster, the small team found themselves mired in exploding complexity. Essential benefits of this architecture became burdens. As our velocity plummeted, our defect rate exploded. Her post is the story of how we took a step back and embraced an approach that aligned well with our product requirements and needs of the team. Brian #4: Helium makes Selenium-Python 50% easier Michael #5: uncertainties package From Tim Head on upcoming Talk Python Binder episode. Do you know how uncertainty flows through calculations? Example: Jane needs to calculate the volume of her pool, so that she knows how much water she'll need to fill it. She measures the length, width, and height: length L = 5.56 +/- 0.14 meters = 5.56 m +/- 2.5% width W = 3.12 +/- 0.08 meters = 3.12 m +/- 2.6% depth D = 2.94 +/- 0.11 meters = 2.94 m +/- 3.7% One can find the percentage uncertainty in the result by adding together the percentage uncertainties in each individual measurement: percentage uncertainty in volume = (percentage uncertainty in L) + (percentage uncertainty in W) + (percentage uncertainty in D) = 2.5% + 2.6% + 3.7% = 8.8% We don’t want to deal with these manually! So we use the uncertainties package. Example of using the library: >>> from uncertainties import ufloat >>> from uncertainties.umath import * # sin(), etc. >>> x = ufloat(1, 0.1) # x = 1+/-0.1 >>> print 2*x 2.00+/-0.20 >>> sin(2*x) # In a Python shell, "print" is optional 0.9092974268256817+/-0.08322936730942848 Brian #6: Personalize your python prompt Arpit Bhayani Those three >>> in the interactive Python prompt. you can muck with those by changing sys.ps1 Fun. But you can also implement dynamic behavior by creating class and putting code in the __str__ method. Very clever. note to self: task for the day: reproduce the windows command prompt with directory listing and slashes in the other direction. Extras: Michael: Now that Python for Absolute Beginners is out, starting on a new course: Hybrid Data-Driven + CMS web apps. Joke: A Python Editor Limerick via Alexander A. CODING ENVIRONMENT, IN THREE PARTS: To this day, some prefer BBEdit. VSCode is now getting some credit. Vim and Emacs are fine; so are Atom and Sublime. Doesn't matter much, if you don't let it. But wait! Let's not forget IDEs! Using PyCharm sure is a breeze! Komodo, Eclipse, and IDEA; CLion is my panacea, and XCode leaves me at ease. But Jupyter Notebook is also legit! Data scientists must prefer it. In the browser, you code; results are then showed. But good luck when you try to use git.
Hands-on with the Galaxy S20 series of phones, and more, with Android Central. Dan Bader gives us the skinny.Learn what’s new and newsworthy from Kayak, the popular travel app and site.SpotOn is a virtual fence for your dog. Find out how this magical collar and app work.
Talk Python To Me - Python conversations for passionate developers
We've come to the end of 2019. Python 2 has just a handful of days before it goes unsupported. And I've met up with Dan Bader from RealPython.com to look back at the year of Python articles on his website. We dive into the details behind 10 of his most important articles from the past year. Links from the show Dan Bader: @dbader_org The 10 Articles on RealPython.com #1: How to Run Your Python Scripts #2: 13 Project Ideas for Intermediate Python Developers #3: 3 Ways of Storing and Accessing Lots of Images #4: Speed Up Your Python Program With Concurrency #5: Build a Recommendation Engine #6: Your Guide to the Python Print Function #7: How to Write Beautiful Python Code With PEP 8 #8: How to Use Python Lambda Functions #9: How to Stand Out in a Python Interview #10: Inheritance and Composition: A Python OOP Guide Sponsors Linode Brilliant Talk Python Training
Dan Bader goes over how he built Real Python from scratch with Django. It serves 4 million+ page views a month and is hosted on Heroku.
Microsoft stunned the tech world last by announcing their return to the smartphone market. Surface Duo is expected in late 2020 and is a dual screen device running Android. Dan Bader speaks with Daniel Rubino of Windows Central and Mr. Mobile, Michael Fisher, about the company's strategy. Show Notes and Links: Surface Duo: Everything we know so far Microsoft 'Surface Andromeda:' Everything we know about the rumored foldable device Microsoft: Productivity Future Vision
In this week’s episode, Editor-in-Chief Mark Kass talked with Ed Rendell, keynote speaker for MBJ’s recent DNC Forum. Rendell shared some of his first-hand experience from hosting the DNC in Philadelphia in 2016. He was chairman of the host committee of that event, and mayor of Philly when the 2000 Republican National Convention was held there. He spoke about how the DNC will affect businesses inside and outside of the broad security perimeter, and the possible long-term benefits Milwaukee could enjoy from hosting next year. Later on, MBJ reporter Sean Ryan visited the headquarters of Bader Philanthropies on Martin Luther King Drive this week to hear from president Dan Bader and Katie Sanders, executive director of Safe and Sound, which has been working with Bader in the area. Bader and Sanders gave Ryan a better idea of economic development in the neighborhoods outside of downtown that are so important to the city’s future, and their future plans. For more information on the stories featured in today’s episode, visit https://www.bizjournals.com/milwaukee/
Python to język programowania ogólnego zastosowania, który w ostatnich latach zyskuje coraz większą popularność nie tylko wśród programistów. Jednym z powodów jest niewątpliwie jego przystępna składnia przez co osoby, które nie są bardzo techniczne są w stanie dość szybko opanować podstawy kodowania w tym języku. Dlatego też Python wydaje się być dobrą propozycją dla Technical Writerów, którzy chcą tworzyć narzędzia wspomagające proces tworzenia treści. Informacje dodatkowe: Codecademy, kurs Pythona: https://www.codecademy.com/learn/learn-python (niestety, za darmo dostępny jest tylko kurs dla Pythona 2) "The Hitchhiker’s Guide to Python!", Kenneth Reitz, Tanya Schlusser: https://docs.python-guide.org/ Real Python: https://realpython.com/ "Python Tricks: The Book", Dan Bader: https://realpython.com/products/python-tricks-book/ Python Bytes Podcast: https://pythonbytes.fm/ Talk Python to Me Podcast: https://talkpython.fm/ Test & Code Podcast: https://testandcode.com/ The Python Standard Library: https://docs.python.org/3/library/ PEP 8 - Style Guide for Python Code: https://www.python.org/dev/peps/pep-0008/ PEP 20 - The Zen of Python: https://www.python.org/dev/peps/pep-0020/ Biblioteka pyjokes: https://github.com/pyjokes/pyjokes Zegar odliczający czas do zakończenia wsparcia Pythona 2: https://pythonclock.org/ Visual Studio Code: https://code.visualstudio.com IntelliJ IDEA: https://www.jetbrains.com/idea/ PyCharm: https://www.jetbrains.com/pycharm/
Keeping up with the work being done in the Python community can be a full time job, which is why Dan Bader has made it his! In this episode he discusses how he went from working as a software engineer, to offering training, to now managing both the Real Python and PyCoders properties. He also explains his strategies for tracking and curating the content that he produces and discovers, how he thinks about building products, and what he has learned in the process of running his businesses.
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-)
See the full show notes for this episode on the website at pythonbytes.fm/80.
Nosso convidado de hoje se intitula “a complete python nut”, gosta de cozinhar comida vegetariana, é o autor do livro `Python Tricks`_, recentemente se tornou o mantenedor do site http://pep8.org, publicou vários vídeos excelentes no YouTube, e, se não fosse o bastante, ele iniciou um projeto chamado `PythonistaCafe`_! É com grande prazer que nos recebemos nosso convidado, `Dan Bader`_.
Olá pessoal e sejam bem-vindos à mais um episódio do Castálio Podcast! Nosso convidado de hoje se intitula “a complete python nut”, gosta de cozinhar comida vegetariana, é o autor do livro Python Tricks, recentemente se tornou o mantenedor do site http://pep8.org, publicou vários vídeos excelentes no YouTube …