Python中的语法错误" full_path_include_patterns = {os.path.join(sync_dir,x)for include in include_patterns}"

时间:2015-04-27 09:20:54

标签: python ubuntu centos

我正在使用dx-toolkit将一些文件上传到natera服务器。

dx_sync_directory.py。

print >> sys.stderr, "Getting files to upload..."

cur_time = int(time.time())
to_upload = []
full_path_include_patterns = {os.path.join(sync_dir, x) for x in include_patterns}

for pattern in full_path_include_patterns:
    full_path_include = glob.glob(pattern)
    for path in full_path_include:
        for root, dirs, files in os.walk(path, topdown=True):
            for name in dirs + files:
                full_path = os.path.join(root, name)
                cur_mtime = os.path.getmtime(full_path)
                if cur_time - cur_mtime > min_age:
                    if (full_path not in log['files']) or (cur_mtime > log['files'][full_path]['mtime']):
                        to_upload.append(full_path)

return to_upload

我在php工作,不知道如何解决这个python语法错误。我使用的操作系统是centos。错误行为full_path_include_patterns = {os.path.join(sync_dir, x) for x in include_patterns}

错误显示为Syntax error: invalid syntax

它在ubuntu Os中运行。

请帮忙。

0 个答案:

没有答案