Home python python. Creating a folder in Linux OS

python. Creating a folder in Linux OS

Author

Date

Category

How to create a folder on a specific path in Python?
Suppose I need to create a folder named ‘1234’ here / HOME / KOROBEINIKOVI / PYPRO .
How to do it?


Answer 1, Authority 100%

Arbitrary nesting + directory can already exist:

from pathlib import path
PATH ("/ HOME / KOROBEINIKOVI / PYPRO / 1234"). MKDir (Parents = True, exist_ok = true)

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions