Create a new directory

1
2
import os
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create a directory using the Operating System module if the directory doesn't already exist.

1 Response

You know, you could use the 'try' and 'except' instead of an if statement, that way you could send a message like "This already exists".

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.