You wrote an amazing Python application and presented it to your boss. He is impressed and wants to use it on his system. He neither has Python installed on his system and nor he has ever worked on it. You are stuck!!!

If the above sounds familiar, then this tutorial will solve your problem. Here, we will learn the process of converting a Python code to a _Windows _executable file. From now onward, every time you want to share your excellent work with the wider community, you don’t have to worry about setting up the Python environment on their systems. Just create an executable and send it to them. They will be able to use the application, just like you do on your system.

What do you need?

1. A script to convert

For this tutorial, we have written a small Python code that reads a ‘.csv’ file from the Windows folder location. This file has 2 columns, each containing a set of random numbers. The code creates a new column that contains the sum of numbers from the 2 input columns. The modified file is saved at the same folder location as the old one.

##### Importing the required library
import pandas as pd

##### Reading csv file
df = pd.read_csv("C:\\Ujjwal\\New_File_V1.csv")
##### Adding 2 columns
df["Third_Column"] = df["Randome Numbers 1"] + df["Random Numbers 2"]
##### Exporting the data to same location
df.to_csv("C:\\Ujjwal\\New_File_V2.csv",index = False)

Sample columns of the input CSV file are as follows:

Image for post

#tips-and-tricks #programming #machine-learning #data-science #python

Convert Your Python Code into a Windows Application (.exe file)
3.30 GEEK