Feb-17-2018, 01:28 PM
(This post was last modified: Feb-17-2018, 01:28 PM by Gribouillis.)
You can use the
__file__
variable. Here is a way to create a directory named 'foo' with the standard pathlib modulefrom pathlib import Path p = Path(__file__).resolve().parent/'foo' if not p.is_dir(): p.mkdir()