it's so funny that #Python's pathlib.Path overrides the division operator to turn it into a path join
from pathlib import Path
this_directory = pathlib.Path(__file__).parent
funny_cat_image = this_directory / "cats" / "cat123.png"
Steffo GoToSocial Actor feed
it's so funny that #Python's pathlib.Path overrides the division operator to turn it into a path join
from pathlib import Path
this_directory = pathlib.Path(__file__).parent
funny_cat_image = this_directory / "cats" / "cat123.png"
@steffo this might be the first good use of operator overloading I've ever seen
@steffo c++ style
@steffo if you divide a number, you get smaller numbers back. If you divide a directory, you get its component parts back (folders and files). I'm suddenly thinking that str / str could be an alias for split; divide a string by spaces.