Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 不显示'/';在文件夹名Django的末尾_Python_Django_Bash_Directory_Slash - Fatal编程技术网

Python 不显示'/';在文件夹名Django的末尾

Python 不显示'/';在文件夹名Django的末尾,python,django,bash,directory,slash,Python,Django,Bash,Directory,Slash,我正在进行的django项目涉及上传文件夹的tar并分析其内容。当我要求它打印tar文件的内容时,它并没有在文件夹名称的末尾打印“/” 查看与该类对应的forms.py中的代码。(上传的tar包含赋值,因此该类命名为AssignmentImportForm): 但它并不是在foldernames的末尾打印“/”。但对于一个tar文件,它正在打印“/”。对于剩余的tar文件,它将按如下方式打印: - assignment.tar.gz | +---Addition

我正在进行的django项目涉及上传文件夹的tar并分析其内容。当我要求它打印tar文件的内容时,它并没有在文件夹名称的末尾打印“
/

查看与该类对应的
forms.py
中的代码。(上传的tar包含赋值,因此该类命名为
AssignmentImportForm
):

但它并不是在foldernames的末尾打印“
/
”。但对于一个tar文件,它正在打印“
/
”。对于剩余的tar文件,它将按如下方式打印:

- assignment.tar.gz
       |
       +---Addition
             |
             +---Configuration
                   |
                   \----Configuration.txt

有人能解释为什么吗?

为什么要打印斜杠?斜杠不是目录的一部分,它是一个分隔符。对于一个tar文件,它正在打印。但对于剩余的文件,它不会打印。是的,斜杠不是目录的一部分,但也不能将“/”放在目录名中。它应该在文件夹名称的末尾打印“/”。是的,但我认为这更多是因为创建tarball的tar程序。名字写在tarball中,因此程序可以决定如何做。
- assignment.tar.gz
       |
       +---Addition
             |
             +---Configuration
                   |
                   \----Configuration.txt