请在下面找到我的Python脚本创建目录内的目录:使用Python脚本语言
import os;
import sys;
dir_dst = sys.argv[1]
for x in range(150) :
dirname = str(x)
dst_dir = os.path.join(dir_dst, dirname)
dirname = "annotation"
dst = os.path.join(dst_dir, dirname)
print dst
if not os.path.exists(dst_dir):
os.mkdir(dst)
目的是创建一个名为“注释”中的每个编号的目录范围如上代码的目录。此代码不能做到这一点,上打印“夏令时”的值,下面是它给出了一个例子:
NLP/test data/reconcile/0\annotation
NLP/test data/reconcile/1\annotation
这又如何解决?
无需使用';'后面的'import'语句 – juliomalegria 2012-01-08 22:45:38
感谢您的输入 – 2012-01-08 23:04:14