0
  1. My code converter code is down here:

    import os
    os.environ['TCL_LIBRARY'] = "C:\\Program Files (x86)\\Python35-32\\tcl\\tcl8.6"
    os.environ['TK_LIBRARY'] = "C:\\Program Files (x86)\\Python35-32\\tcl\\tk8.6"
    
    from cx_Freeze import setup, Executable
    if __name__.endswith('__main__'):
        setup(name = "Dodge The Blocks",
            version = "2.0",
            description = 'A fun little game for when your bored',
            executables = [Executable(r"C:\Users\Harshal\Desktop\GameWIP.py")]
            )
    
  2. I also wanted to ask that what does this mean:

    if __name__.endswith('__main__'):
    
jpeg
  • 2,372
  • 4
  • 18
  • 31
  • What is the error message? – Henry Yik Aug 06 '19 at 07:25
  • Please take the time to read https://cx-freeze.readthedocs.io/en/latest/distutils.html#distutils-commands for how to create and use a cx_Freeze setup script. Once you have improved your script accordingly, if it still does not work please add the improved script and the full error message to your question. And if you want to use the TCL/TK libraries with cx_Freeze 5.1.1, please refer to [this answer](https://stackoverflow.com/a/56495955/8516269). – jpeg Aug 06 '19 at 07:27
  • 1
    thx i will try that – 8112006DOOM Aug 06 '19 at 07:31
  • i am kinda new to cx freeze so when i read the docs i hardly understood anything also i am using tkinter. – 8112006DOOM Aug 06 '19 at 07:53
  • I tried something and it game me this error i have given a link to the image of the error https://ibb.co/B6srHyy – 8112006DOOM Aug 06 '19 at 07:59
  • I edited my answer accordingly. Please post your error message as text, not as an image, see [Why not upload images of code on SO when asking a question?](https://meta.stackoverflow.com/q/285551/8516269) – jpeg Aug 06 '19 at 08:12
  • and btw can we get in a discord call regarding this my dis is #5512 username is 8112006DOOM – 8112006DOOM Aug 06 '19 at 22:26

1 Answers1

0
  1. Regarding the first part of your question: see this answer for a working setup script to freeze an application relying on tkinter using cx_Freeze 5.1.1 (and also see my comment to your question)

  2. Regarding the second part of your question

    what does this mean:

    if __name__.endswith('__main__'):
    

    See What does if __name__ == "__main__": do?

    You probably got the modified version you are using from this issue or a similar one. In any case, this line and its modification might be relevant for the main application, but is not necessary in the setup script and should be removed from there.

jpeg
  • 2,372
  • 4
  • 18
  • 31