2017-12-14 3 views
1

pyinstaller "onefile"실행 파일에 DLL과 텍스트 파일을 포함해야합니다. DLL을 추가 할 수 있지만 두 파일을 모두 지정하려고하면 pyinstaller가 불평합니다. 필자는 spec 파일이 아닌 명령 행 옵션을 사용하려고합니다. 여러 파일의 올바른 형식은 무엇입니까? pyinstaller에 여러 데이터 파일 포함

http://pyinstaller.readthedocs.io/en/stable/usage.html#options-group-what-to-bundle-where-to-search

http://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-data-files

는 몇 가지, 예를 시도 pyinstaller : 오류 : 인수 - 추가 - 데이터 : 잘못되었습니다 add_data_or_binary 값 : '/C/path1/my.dll;/c/path2/my.txt ;.'

답변

1

명령 줄에 어떤 구문이 필요한지 알 수 없지만 은 데이터에 대한 경로를 포함하도록 생성 된 사양을 편집 할 수 있습니다. 여기서 데이터는 튜플 목록 인 입니다.

datas = [('/path/to/file', '/path/in/bundle'). 
      (...) ] 

그래서 같이 보일 수 있습니다 사양은 다음과 같습니다 다음

a = Analysis(['Frequency_Analysis_DataInput_Animation_cge.py'], 
      pathex=['C:\\Users\\mousavin\\Documents\\Analysis'], 
      binaries=[], 
      datas=[('/path/file1', '.'), (/path/file2, '.')], 
... 

빌드를 다시

pyinstaller script.spec 
관련 문제