Jump to content

Python creating a file in the setup

Wictorian

So I am using py2exe to convert a python script to an executable but I wanna create a file in the same directory.

How can I do this in the setup script? 

Link to comment
Share on other sites

Link to post
Share on other sites

It's in the "dist" folder after you run the setup. The tutorial explains how to make the executable: https://www.py2exe.org/index.cgi/Tutorial

A bit of googline tells there is a "-d" flag to tell the output directory: https://stackoverflow.com/questions/5811960/is-there-a-way-to-specify-the-build-directory-for-py2exe

 

It is good practise to keep the separate build and dist folders though. That way you can easily track what is just build-time stuff and actual distributable and runnable stuff.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×