Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my latest function
#1
i just wrote a function and will be writing tests for it soon. i wrote it because i frequently need this. it mimics open() (by calling it at the end) but creates any needed parent directories along with support for a named parameter parentsmode= to set the creation mode for all the parents being created (existing ones are not changed). i call it opend(). it uses pathlib to work out the parents. do you think i wasted my time?

one thing i noticed with error messages and exception messages from pathlib is that messages like to reference the full original argument path that was passed as an argument. since i had to run my own loop to set the mode on each directory being created, i chose to add the parent directory path in my messages.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
my latest function - by Skaperen - Jun-08-2019, 12:51 AM
RE: my latest function - by heiner55 - Jun-08-2019, 04:38 AM
RE: my latest function - by Skaperen - Jun-08-2019, 08:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to install the latest version of Python on RHEL 8? devlocalca 7 5,484 Feb-17-2020, 01:49 AM
Last Post: snippsat
  Any command to upgrade Python version 2.X to latest KarthiK 7 4,164 Feb-15-2020, 07:25 PM
Last Post: DeaD_EyE
  Latest news on Tim Berners-Lee's Inrupt Larz60+ 2 2,555 Mar-07-2019, 11:35 PM
Last Post: Larz60+
  latest astroid dependencies break mypy astir13 2 2,408 Feb-28-2019, 02:14 PM
Last Post: astir13

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020