How can I include a folder with cx_freeze?

Posted on

Solving problem is about exposing yourself to as many situations as possible like How can I include a folder with cx_freeze? and practice these strategies over and over. With time, it becomes second nature and a natural way you approach any problems in general. Big or small, always start with a plan, use other strategies mentioned here till you are confident and ready to code the solution.
In this post, my aim is to share an overview the topic about How can I include a folder with cx_freeze?, which can be followed any time. Take easy to follow this discuss.

How can I include a folder with cx_freeze?

I am using cx_freeze to deploy my application. I would like to include a entire directory since including individual files doesn’t put them in a folder. How can I include a folder?

Asked By: Casebash

||

Answer #1:

You have to set up an include files argument for the building options. You can do this in different ways, but I will show a part of my configuration. The thing I describe here is for one specific file and one specific destination. I think you can also set a path like this, but I don’t have tested this yet.

Edit: Tested this, so choose the right approach for your project.

buildOptions = dict(include_files = [(absolute_path_to_your_file,'final_filename')]) #single file, absolute path.
buildOptions = dict(include_files = ['your_folder/']) #folder,relative path. Use tuple like in the single file to set a absolute path.
setup(
         name = "appname",
         version = "1.0",
         description = "description",
         author = "your name",
         options = dict(build_exe = buildOptions),
         executables = executables)

Take also a look at this topic. It adressed propably the same question: How can i bundle other files when using cx_freeze?

Answered By: Casebash
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.