0

I created a reddit scraper which will download pictures from reddit and change my wallpaper. It works the way I want it to without any issues. I created an executable for the app using cx_Freeze with the following setup.py

from cx_Freeze import setup, Executable

base = "Win32GUI" # Without Console
# base = None ## With Console
includefiles = ["WallpaperUpdater.ico", "templates/"]

executables = Executable(
    script="WallpaperUpdater.py",
    base=base,
    icon="WallpaperUpdater.ico"
)

packages = ["idna", "requests", "multiprocessing"]
options = {
    "build_exe":
    {
        "packages": packages,
        "include_files": includefiles
    },
}

setup(
    name="Wallpaper Updater",
    options=options,
    version="0.1",
    description="Downloads top images form subreddits and change wallpaper",
    executables=[executables]
)

Modules other than stock modules being used -

  1. Praw
  2. PyQt5
  3. schedule

This issue is when I try to build it without the console it does not work. I think it does not send a message to the socket to retrieve the refresh token. But this works when I build it with the console.

Would appreciate any help. Thank you.

Vinay Bharadhwaj
  • 165
  • 1
  • 17
  • Which version of Python are you using? Which modules are you using in your main application? What do you mean with "does not work": does it run without effect, or does it raise an error? In that case, what is the full error message? – jpeg Mar 11 '19 at 09:20
  • Hey jpeg, I am using python 3.7. I have edited the question to now show the extra modules I am using. Other than those I am using Webbrowser and socket. As I have mentioned, when I build the app with a console, where the base is None, the app works. It connects to reddit, and redirects to my redirect_url. But when the base is "Win32GUI" my app will close without the redirection. No error message gets printed – Vinay Bharadhwaj Mar 11 '19 at 09:28
  • 1. There are known issue of `cx_Freeze` with python 3.7, see [Cx_freeze crashing Python3.7.0](https://stackoverflow.com/questions/51314105/cx-freeze-crashing-python3-7-0). It could also be that the `Win32GUI` is not correctly supporting python 3.7. Have you tried with python 3.6? 2. What happens if you start your executable from a `cmd` prompt, do you get any error message or warning? – jpeg Mar 11 '19 at 10:23
  • Yea, maybe I should raise an issue about it now but I have not tried with 3.6. And there is no error or warning that appears in the console – Vinay Bharadhwaj Mar 11 '19 at 13:10

0 Answers0