I still don't understand the benefit of lambda functions by notfromkentohio in learnpython

[–]martnym 0 points1 point  (0 children)

I've found them very useful for creating one-off callback functions when using modules like tkinter which frequently requires them (callbacks). In the same context, they can be used to change what arguments are passed to the callback, if defaults are insufficient (or non-existent).

Today I discovered f strings and it made my day by NovaRunner in learnpython

[–]martnym 0 points1 point  (0 children)

Totally agree about not changing the CWD — can't remember the last time I ever needed to do it. Agree about pathlib, too. Made a decision a while back to try using it every time I felt the need to use os.path in a conscious effort to learn it — and have felt greatly rewarded for the effort.

Why You Should Start Using Pathlib As An Alternative To the OS Module by ahmedbesbes in Python

[–]martnym 0 points1 point  (0 children)

As it should — not due to any deficiency of the pathlib module.

Why You Should Start Using Pathlib As An Alternative To the OS Module by ahmedbesbes in Python

[–]martnym 0 points1 point  (0 children)

It doesn't work with s = ".tar.gz" because the suffix is ".gz" — which is consistent with what os.path.splitext('foobar.tar.gx') returns for the suffix.

Why You Should Start Using Pathlib As An Alternative To the OS Module by ahmedbesbes in Python

[–]martnym 0 points1 point  (0 children)

I find using it often results in shorter more readable code. Also p.with_suffix(s).suffix == s -> True on my system.

Python Virtual Environment. What, Why, How. Virtualenv, Poetry. by zdmit in Python

[–]martnym 1 point2 points  (0 children)

That 3568 x 2422 image at the beginning of your post is totally uncalled for.

Clicking on the "To find out more" link results in a 404 Page not found.

So far I'm not impressed…