Erik
1.2K posts

Erik
@erikyan
Writer, Python instructor. Learn Python @ https://t.co/chZZ9TnCVF
Amsterdam, The Netherlands Katılım Şubat 2009
335 Takip Edilen1.9K Takipçiler

X leidt bezoekers van de homepage van twitter.com voortaan om naar x.com. Dat levert voor sommige Firefox-gebruikers wel problemen op. tweakers.net/nieuws/222068/…
Nederlands

@NOS "het gaat om een man", meldt de politie.
Hoe weet de politie dat nou? Als er een overleden persoon op straat ligt die het uiterlijk heeft van een man, dan kan het toch nog best zijn dat ie zich als vrouw identificeert en geen man genoemd wil worden??
Nederlands

To learn all about strings, head over to my extensive article on strings: python.land/introduction-t…
English
Erik retweetledi

With Pyenv, you can start using Python 3.12 right away since they've added it to their list of supported versions as soon as it came out. Learn more about Pyenv here 👇
python.land/virtual-enviro…
English

🐍 #Python Tip: Want to remove the last letter from a word using slicing? Here's how:
word = "Python"
new_word = word[:-1]
print(new_word) # Outputs 'Pytho'
Learn more here: #Reversing_a_string_slicing" target="_blank" rel="nofollow noopener">python.land/introduction-t…
English

Another notable thing is using a per-interpreter GIL. The GIL ensures there is only one thread running at any time. Because only one thread can run at a time, using multiple processors with threads is impossible right now.
Read more here:
#whatsnew312-pep684" target="_blank" rel="nofollow noopener">docs.python.org/3.12/whatsnew/…
English

Yesterday, Python 3.12 was released. Many people won't use it for a while since most lag behind a few versions for various reasons. Nevertheless, you can check out what's new in this post: docs.python.org/3.12/whatsnew/…
English

🔄 Python’s itertools module is a collection of fast, memory-efficient tools that are useful for working with iterators (e.g., loops). Explore more: #Python" target="_blank" rel="nofollow noopener">docs.python.org/3/library/iter… #Itertools #Coding #Developer
English
Erik retweetledi

🤖 Python #Trivia: The name 'Python' was not derived from the snake but from the British comedy series 'Monty Python’s Flying Circus'! 📺 What's your favorite Python fun fact? 🧠 #PythonProgramming #DidYouKnow
English
Erik retweetledi

TIL about math.isclose() to compare floating-point numbers in #Python
I already knew about pytest's approx() which is similar, but turns out the Standard Library has you covered once more:
x = 0.1 + 0.2
print(x == 0.3) # False 😱
# need a small tolerance
import math
print(math.isclose(x, 0.3)) # True
So math.isclose() checks whether two numbers are close enough to each other, within a given tolerance, avoiding the pitfalls of floating-point comparison.
#tips #pythonprogramming
English
Erik retweetledi

Optimus can now sort objects autonomously 🤖
Its neural network is trained fully end-to-end: video in, controls out.
Come join to help develop Optimus (& improve its yoga routine 🧘)
→ tesla.com/AI
English

@xcraftsdesign That's a really good one, thanks! Super handy to toggle quickly because you don't want to see all the hidden Mac files all the time.
English

@erikyan #macOSTricks By default, macOS hides (pardon the redundancy) hidden files. This might be especially frustrating for developers working with files such as .git, .gitignore, etc.
Pressing Command + Shift + Period (⌘ ⇧ .) you can toggle hidden files on and off.

English



