create a directory python
#creates a directory without throwing an error import os def create_dir(dir): if not os.path.exists(dir): os.makedirs(dir) print("Created Directory : ", dir) else: print("Directory already existed : ", dir) return dir
create a directory python
#creates a directory without throwing an error import os def create_dir(dir): if not os.path.exists(dir): os.makedirs(dir) print("Created Directory : ", dir) else: print("Directory already existed : ", dir) return dir
create folder python
import os # define the name of the directory to be created path = "/tmp/year" try: os.mkdir(path) except OSError: print ("Creation of the directory %s failed" % path) else: print ("Successfully created the directory %s " % path)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us