0

I have a python code that run perfect now i want to convert this code into an executable file .I am using python 3.6.

Until now I was able to convert it ,and make it run but the problem is that when the user try to run the .exe file cmd window is opened.

how can I make the cmd window to be hidden OR to not show?

the code below is to create the build folder that includes the converted executable file.

setup.py

import cx_Freeze
import sys
import os
import matplotlib

#os.environ['TCL_LIBRARY'] = "C:\\LOCAL_TO_PYTHON\\Python35-32\\tcl\\tcl8.6"
#os.environ['TK_LIBRARY'] = "C:\\LOCAL_TO_PYTHON\\Python35-32\\tcl\\tk8.6"


os.environ['TCL_LIBRARY'] = "C:\\EXECUTABLE_PROGRAMS\\Python3.6\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\EXECUTABLE_PROGRAMS\\Python3.6\\tcl\\tk8.6"


base = None

if sys.platform == 'win32':
    base='Win32GUI'

executables = [cx_Freeze.Executable("myPDFviewer.py",base=None)]

cx_Freeze.setup(
    name = "this is a test",
    options = {"build_exe": {"packages":["numpy"],}},
    version = "0.01",
    descriptions = "Trying to get this to work",
    executables = executables
    )
Py Dev
  • 45
  • 8
  • How did you convert the python project to an .exe? – Ron Nabuurs Apr 16 '18 at 09:07
  • no sir its not a duplicate question. i installed the cx_Freeze package and create a setup file i will edit my question and add the code – Py Dev Apr 16 '18 at 09:10
  • It's still a duplicate, but from an other question (my bad). Read through here: [Question](https://stackoverflow.com/questions/29650935/cx-freeze-help-is-there-a-way-to-not-make-console-open?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa) – Ron Nabuurs Apr 16 '18 at 09:15
  • TLDR: you should define `base=None` as `base="Win32GUI"` – Ron Nabuurs Apr 16 '18 at 09:16
  • thank you this was the issue convert your comment into an answer to up vote – Py Dev Apr 16 '18 at 10:01

1 Answers1

0

Change base=None to base="Win32GUI"

Ron Nabuurs
  • 1,528
  • 11
  • 29