how to turn a python file into an executable code example

Example 1: python to exe

pip install pyinstaller

cd FullPathOfFile in cmd console
pyinstaller --onefile pythonScriptName.py
# a .exe file is created in the FullPathOfFile\dist

Example 2: how to run a .exe through python

import os
os.startfile("C:\Documents and Settings\flow_model\flow.exe")

Example 3: how to convert python file to exe

# for windows only, connot say for other operating systems
open command prompt
 type "pip install pyinstaller"
# let it install
after it is installed
 locate to the file in cmd(command prompt) using cd
  for example : cd /folder/location
after you are in that folder type:
    pyinstaller file_name.py --onefile -w
# in place of file_name.py type the file's name you want to convert.
now pyinstaller will give you different type of files 
 to locate the .exe file you want go into the folder,
  then go into dist folder and you will find it.
now you are done! BOYAAH !!
@important note -> if this gives you an error then you need to use py2exe module
# Author Rudra the great