About 459,000 results
Open links in new tab
  1. python - How to create new folder? - Stack Overflow

    I want to put output information of my program to a folder. if given folder does not exist, then the program should create a new folder with folder name as given in the program. Is this possible? I...

  2. python - How do I create a directory, and any missing parent ...

    How do I create a directory at a given path, and also create any missing parent directories along that path? For example, the Bash command mkdir -p /path/to/nested/directory does this.

  3. python - Workflow to create a folder if it doesn't exist already ...

    Aug 20, 2015 · In this interesting thread, the users give some options to create a directory if it doesn't exist. The answer with most votes it's obviously the most popular, I guess because its the shortest …

  4. python - Automatically creating directories with file output - Stack ...

    In Python 3.2+, using the APIs requested by the OP, you can elegantly do the following:

  5. python - Checking folder and if it doesn't exist create it - Stack Overflow

    Dec 5, 2021 · I am quite new to python so I need some help. I would like to create a code that checks if a folder with a given name is created, if not, it creates it, if it exists, goes to it and in it checks if...

  6. python - Create new folder with pathlib and write files into it - Stack ...

    Create new folder with pathlib and write files into it Asked 8 years ago Modified 2 years, 3 months ago Viewed 243k times

  7. python - How to import a module from a different folder ... - Stack ...

    from ..models import some_model which gave me ValueError: attempted relative import beyond top-level package. What am I doing wrong here? How can I import a file from a different directory, which …

  8. Python pathlib make directories if they don’t exist

    May 1, 2018 · If I wanted to specify a path to save files to and make directories that don’t exist in that path, is it possible to do this using the pathlib library in one line of code?

  9. python - New folder that is created inside the current directory ...

    Jan 2, 2013 · I have a program in Python that during the processes it creates some files. I want the program to recognize the current directory and then then creates a folder inside the directory, so that …

  10. python - Importing files from different folder - Stack Overflow

    I have this folder structure: application ├── app │ └── folder │ └── file.py └── app2 └── some_folder └── some_file.py How can I import a function from file.py, from within som...