@pybites@fosstodon.org
@pybites@fosstodon.org avatar

pybites

@pybites@fosstodon.org

Helping people from 120+ countries to improve their #Python/ #developer/ #mindset skills. Created by https://fosstodon.org/@bbelderbos & https://fosstodon.org/@juliansequeira. Join us: http://pybit.es/community/

This profile is from a federated server and may be incomplete. Browse more on the original instance.

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

@treyhunner does a deep dive of #Python's many command-line utilities. 🙏 🔥

First of all it's good to know that you can use -m to run a Python module as if it were a script 💡

There are some nifty ones like inspect / json.tool / zipapp. You'll surely pick up new ones ... 💪

bbelderbos, to rust
@bbelderbos@fosstodon.org avatar

Are you looking to create your own tech blog? 💡

A static site generator + GitHub Pages is a great combo. 😍

I started to use Zola to document my learning (Zola is written in Rust) and it's easy to use, has nice themes and is super fast. 🏃 📈

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

Ever wondered how to debug a hanging test in ?

pip install pytest-timeout
pytest --timeout=N_SECONDS

To dump the whole stack trace you can add --timeout_method=thread as well.

Here is an example:

bbelderbos, to Podcast
@bbelderbos@fosstodon.org avatar

And we're back with a new @pybites episode debriefing Pycon US 2024: favorite moments, takeaways / lessons, inspiration, and more. 😍 📈 🔥

And as usual we geek out over 😄 💡

Check it out here:
https://www.youtube.com/watch?v=-JR9QbXCF1U

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

In our latest @pybites podcast I list out 10 essential things to add to your project on .

Hope it helps you if you're not sure where to start.

Check it out here: https://youtu.be/eBq4v_eOD-Y

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

Custom exceptions boost code clarity and intent in #Python, aligning with the Zen's "explicit is better than implicit."

Check out this clean example from the pyjokes package:

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

What is the Zen of #Python all about? Robin and I produced a bunch of YouTube shorts a while back. 💪

We hope you indulge with us for a bit, reflecting on why we think it explains much of Python's elegance and awesomeness 🐍 😍 💡

Enjoy! https://www.youtube.com/watch?v=h-8Ij34nab8&list=PLhaG3iqe9VDa9uHRV3RBf8q1DCSSD5Vu7

bbelderbos, to random
@bbelderbos@fosstodon.org avatar

Exciting new @pybites episode: we talk with Pydantic creator @samuelcolvin about how Pydantic came about, how it became a company, future vision, FastUI, and Pydantic's newly released Logfire product 😍 (including a demo 💡). Check it out here:
https://youtu.be/KZHvs_j6fuA - enjoy 🎧

bbelderbos, to random
@bbelderbos@fosstodon.org avatar

Had a great conversation with @jhodapp to talk about the power of #coaching (and mindset) to advance your career as a #developer 💡 📈

Check it out here: https://reltech.substack.com/p/why-coaching-propels-your-software - thanks Jim 🙏

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

Set operations in #Python work on dictionaries as well, because they implicitly operate on the keys, not the values. Ideal for quick key comparisons 🚀

Here is a quick example:

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

In our new podcast episode, Julian chats with Luis Palacios, who transitioned from custodian to IT Analyst.

His inspiring journey into tech highlights how solid #Python and #mindset training can truly open new doors. Check it out! 🚀

https://www.youtube.com/watch?v=Rmr42vZq6T4

#developer #podcast

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

The divmod() #Python built-in function combines division + modulo operations into one, returning the quotient + remainder.

Here's an example to calculate how many years + days @pybites is old (simplified way, for more accurate/realistic date calculations -> python-dateutil).

bbelderbos,
@bbelderbos@fosstodon.org avatar

Subscribe to our newsletter for 250 more #Python tips: https://pybit.es/newsletter/

bbelderbos, to random
@bbelderbos@fosstodon.org avatar

We're back with a new @pybites episode! 🎙️

Dive into our latest discussion on adopting the right #mindset to navigate layoffs effectively. 💡

Don't miss out on some good advice and tips to boost your #career as a #developer 💪 📈

👉 https://www.youtube.com/watch?v=k2D5IM1tKLg

digiglean, to random

I was on the @pybites podcast with @bbelderbos. Talking about programming, music, and learning Python. https://m.youtube.com/watch?si=eOezK4hsBWdUaGw2&v=KmgGCETyhzs&feature=youtu.be

paulox, to Podcast
@paulox@fosstodon.org avatar

I've been the guest on the latest episode of the PyBites podcast 🎙️

Thanks again Bob for the nice chat 😀

You can find the links to listen to or watch the episode on my website 👇
https://www.paulox.net/2024/03/15/pybites-podcast-155/

#PyBites #Podcast #Python #Django #OpenSource #PyCon

CC @pybites @bbelderbos

slott56, to python
@slott56@fosstodon.org avatar

#python #programming @pybites #technomad

https://www.pybitespodcast.com

Coming soon. An episode where I talk about Python and being a technomad.

tonybaloney, to random
@tonybaloney@fosstodon.org avatar

Finally catching up with one half of @pybites

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

Refactoring Code with Enums: Enhance Your #Python Projects 🐍 🚀

https://www.youtube.com/watch?v=dXT58xiYF1w

bbelderbos, to literature
@bbelderbos@fosstodon.org avatar

Love geeking out over DALL-E in ChatGPT!

So much even that Julian and I are combining our passion for #literature, #art and #AI into book scene images. 💡 🎉

Check out https://www.instagram.com/visualizeliterature/ for more ...

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

In today's #Python refactoring video I show you how to go from a set of related functions to a simple class, leading to cleaner code, better data encapsulation and even a possible efficiency gain -> https://youtu.be/btBFH5GKd-k?si=Zaa7daieoHOh6G3V

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

New #Python refactoring video: From Long List of Arguments to Object
https://www.youtube.com/watch?v=fJmZAsulP7g

bbelderbos, to random
@bbelderbos@fosstodon.org avatar

🐍 Python pitfall: don’t modify a list while iterating over it 😱

You might run into unexpected results if you try removing elements from a list while iterating over it:

numbers = list(range(1, 50))
for i in numbers:
if i < 20:
numbers.remove(i)
print(numbers)

Expected output: All numbers below 20 are removed.

Actual output: [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, ..., 49] 🤯

bbelderbos,
@bbelderbos@fosstodon.org avatar

❗Why?

When an element is removed, the list is re-indexed, and the next item is skipped during iteration.

✅ Solution: build up a new list using a list comprehension:

numbers = list(range(1, 50))
numbers = [n for n in numbers if n >= 20]
print(numbers)

Now, numbers contains [20, 21, ..., 49], as expected!

This way, you avoid the pitfall of modifying a list while iterating over it 😍 📈

  • Bonus: the use of a list comprehension or "listcomp" is very Pythonic 🐍

#python #tips #pythonprogramming

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

The Zen of #Python warns about nested code, it better be flat!

Check out my new #refactoring video where we go from the code on the left to the code on the right:

https://www.youtube.com/watch?v=3dUKpvSBgLE

image/png

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

I created another refactoring video, today a practical example of "Extract Method" in #Python
https://youtu.be/N9sqd1-0_qk?si=7oW0D3c-GdvtrzG-

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • normalnudes
  • osvaldo12
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • tacticalgear
  • ethstaker
  • provamag3
  • anitta
  • Leos
  • cisconetworking
  • lostlight
  • All magazines