directory-structure

Elegant way to take basename of directory in Python?

Elegant way to take basename of directory in Python? Question: I have several scripts that take as input a directory name, and my program creates files in those directories. Sometimes I want to take the basename of a directory given to the program and use it to make various files in the directory. For example, …

Total answers: 6

mkdir -p functionality in Python

mkdir -p functionality in Python Question: Is there a way to get functionality similar to mkdir -p on the shell from within Python. I am looking for a solution other than a system call. I am sure the code is less than 20 lines, and I am wondering if someone has already written it? Asked …

Total answers: 12

What is the best project structure for a Python application?

What is the best project structure for a Python application? Question: Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project’s folder hierarchy? Desirable features are ease of maintenance, IDE-friendliness, suitability for source control branching/merging, and easy generation of install packages. …

Total answers: 8