Python和macosx上的mkdir

2024-06-25 22:46:09 发布

您现在位置:Python中文网/ 问答频道 /正文

Python2,Mac OS X 10.11。。。在

我在github上找到的。除此之外,一切正常:

error = Popen("%s \"mkdir -p '%s'\"" % (PathZero, MyPath), shell=True, stdout=PIPE, stderr=PIPE).stderr.read()
    if error != '':
        send_msg("%sError creating path:\n\t%s" % (red_minus, error), False)
    else:
        send_msg("%sCreated path '%s'.\n" % (PathTwo, PathOne), False)

我总是得到:

Error creating path

/bin/sh: /Users/test/Downloads/File: Permission denied

这个文件夹我不需要“sudo”。我觉得这个有点问题:Popen(“%s\”mkdir-p“%s”\“”


Tags: pathcreatinggithubsendfalseosmacstderr