pyinstaller可以';不要添加文本文件

pyinstaller可以';不要添加文本文件,pyinstaller,Pyinstaller,我制作了一个虚拟python应用程序来测试pyinstaller。它包含testFile.py和referenceText.txttestFile.py只需从同一目录读取文本文件并打印: #testFile.py text = [] with open('./referenceText.txt', 'r') as infile: for line in infile: text.append(line.strip()) print(' '.join(text))

我制作了一个虚拟python应用程序来测试pyinstaller。它包含
testFile.py
referenceText.txt
testFile.py
只需从同一目录读取文本文件并打印:

#testFile.py

text = []

with open('./referenceText.txt', 'r') as infile:
    for line in infile:
        text.append(line.strip())

print(' '.join(text))
当我运行
pyinstaller testFile.py--onefile--add data'referenceText.txt:。
然后运行由它创建的可执行文件时,我得到以下错误:FileNotFoundError:[Errno 2]没有这样的文件或目录:'./referenceText.txt',即使
testFile.spec
文件在其分析构造函数中有以下参数:
datas=[('referenceText.txt','.]),

我是否正确使用了
--add data
选项?我是否需要指定其他目的地而不是使用