Python EXE file creation

Viewed 123

I have this code which i need to create it as a python exe file, where in user has to click the workflow done.

My Sample Project

import os
import pandas as pd
import sys
import csv

path = os.getcwd()

v1 = pd.read_csv(r"path\V1.tsv", delimiter = '\t')

v1.to_csv(r"path\v2.csv", index=False)

I used Pyinstaller to create a .exe file but it didnt help me achieve what I want. Can some one suggest me?

2 Answers

Depending on what disappointed you about PyInstaller, (speed? size? too many files in directory?), you may either want to try:

  • PyInstaller's --onefile flag, which will compile everything into one .exe file but will take forever to run
  • cx_Freeze. This can generate .exe files like PyInstaller, though performance won't be much better. What I find most useful is to compile the files into an installer by calling py setup.py bdist_msi (Windows) or py setup.py bdist_dmg (Linux). People can use the installer to add the .exe to their machines. Installer-created .exe files will run very quickly.

Have your tried using the --onefile flag to specify that you only want 1 exe file to be created for that script.

For example use the cmd: pyinstaller --onefile file_name.py

If this does not help can you specify the issue that is occurring.

Related