i am using python 2.7 and py2exe to try and make an exe file for my script. but it is not going so well.. my file works perfectly until I add the py2exe commands what am I doin wrong here? I need to know how to write the setup function and call it so that python knows to create and EXE file not just a compiled .py. Also this is attempted using a windows operating system.
from time import strftime
import os.path
# setup.py
import py2exe
setup(console=["LogFile.py"])
def main():
getTime()
def getTime():
time = strftime("%Y-%m-%d %I:%M:%S")
printTime(time)
def printTime(time):
savePath = "C:\Users\Nicholas\Documents"
logFile = "LogInLog.txt"
files = open(os.path.join(savePath, logFile), "a+")
openPosition = files.tell()
files.write("A LogIn occured.")
files.write(time)
files.seek(openPosition)
print(files.read())
files.close()
main()