Directory is now created
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from glob import glob
|
from glob import glob
|
||||||
@@ -57,6 +58,10 @@ class Images:
|
|||||||
self.basename = basename
|
self.basename = basename
|
||||||
self.suffix = ".jpg"
|
self.suffix = ".jpg"
|
||||||
self.count_width = 5
|
self.count_width = 5
|
||||||
|
# Ensure directory exists
|
||||||
|
dirname = os.path.dirname(self.basename)
|
||||||
|
if not os.path.exists(dirname):
|
||||||
|
os.makedirs(dirname)
|
||||||
# Find existing files
|
# Find existing files
|
||||||
count_pattern = "[0-9]" * self.count_width
|
count_pattern = "[0-9]" * self.count_width
|
||||||
pictures = glob(self.basename + count_pattern + self.suffix)
|
pictures = glob(self.basename + count_pattern + self.suffix)
|
||||||
|
|||||||
Reference in New Issue
Block a user