Ameba Ownd

アプリで簡単、無料ホームページ作成

fullmatafo1971's Ownd

Spec file attr

2022.01.16 00:55




















Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 10 years, 11 months ago. Active 2 years, 11 months ago. Viewed 7k times. AkshathaRamesh if your question is answered, then please consider accepting any of these answers to mark your question as solved. You can optionally upvote other usefull answers.


Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.


It is usually enough to give all the needed information such as hidden imports as options to the pyinstaller command and let it run. When you want to include run-time libraries. The options are the same options documented above for the pyinstaller command. This command creates the name. After you have created a spec file and modified it as necessary, you build the application by passing the spec file to the pyinstaller command:. When you create a spec file, most command options are encoded in the spec file.


When you build from a spec file, those options cannot be changed. If they are given on the command line they are ignored and replaced by the options in the spec file. After PyInstaller creates a spec file, or opens a spec file when one is given instead of a script, the pyinstaller command executes the spec file as code.


Your bundled application is created by the execution of the spec file. The following is a shortened example of a spec file for a minimal, one-folder app:. A new instance of class Analysis takes a list of script names as input.


It analyzes all imports and other dependencies. The resulting object assigned to a contains lists of dependencies in class members named:.


An instance of class PYZ is a. This object creates the executable file. You modify the spec file to pass additional values to Analysis and to EXE. To add files to the bundle, you create a list that describes the files and supply it to the Analysis call. When you bundle to a single folder see Bundling to One Folder , the added data files are copied into the folder with the executable. This means that any changes a one-file executable makes to an added file will be lost when the application ends.


In either case, to find the data files at run-time, see Run-time Information. You can add data files to the bundle by using the --add-data command option, or by adding them as a list to the spec file.


The list of data files is a list of tuples. Each tuple has two values, both of which must be strings:. For example, to add a single README file to the top level of a one-folder app, you could modify the spec file as follows:.


That file will be looked up relative to the location of the spec file and copied into the top level of the bundled app. For example to include all the. All the. If the data files you are adding are contained within a Python module, you can retrieve them using pkgutil. For example, suppose that part of your application is a module named helpmod. In the same folder as your script and its spec file you have this folder arrangement:.


Because your script includes the statement import helpmod , PyInstaller will create this folder arrangement in your bundled app. However, it will only include the. To cause it to be included also, you would add a datas tuple to the spec file:. However, this data file is part of a module, so you can also retrieve its contents using the standard library function pkgutil. If it is actually characters, you must decode it:.


Binary files refers to DLLs, dynamic libraries, shared object-files, and such, which PyInstaller is going to search for further binary dependencies. Files like images and PDFs should go into the datas.


You can add binary files to the bundle by using the --add-binary command option, or by adding them as a list to the spec file.


In the spec file, make a list of tuples that describe the files needed. A file or directory that has an associated reparse point. A file or directory that is compressed. For a file, all of the data in the file is compressed. For a directory, compression is the default for newly created files and subdirectories.


The data in this file is not available immediately. This attribute indicates that the file data is physically moved to offline storage. This attribute is used by Remote Storage, which is hierarchical storage management software. A file or directory that is not indexed by the content indexing service. A file or directory that is encrypted. For a file, all data streams in the file are encrypted. For a directory, encryption is the default for newly created files and subdirectories. A file or directory that is configured with integrity support.


For a file, all data streams in the file have integrity support.