2020-04-24 20:33:55 +02:00
|
|
|
import os
|
|
|
|
|
2020-04-25 16:11:36 +02:00
|
|
|
|
2020-04-24 20:33:55 +02:00
|
|
|
def CallFuncInDir(Directory, Function, *args, **kwArgs):
|
|
|
|
CurrentDir = os.getcwd()
|
|
|
|
os.chdir(Directory)
|
|
|
|
Function(*args, **kwArgs)
|
|
|
|
os.chdir(CurrentDir)
|
|
|
|
|
2020-04-25 16:11:36 +02:00
|
|
|
|
2020-04-24 20:33:55 +02:00
|
|
|
# return True if operation succesful and False if failed
|
|
|
|
def CreateDir(Directory):
|
|
|
|
if not os.path.isfile(Directory):
|
|
|
|
if not os.path.isdir(Directory):
|
|
|
|
os.mkdir(Directory)
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
return False
|