I have decided for practice purposes, I'd write a Passwordgenerator and make it an executable.
My script is running as it is intended, and the compiling works as well, but when I run the exe file, nothing happens.
I run a Windows 10 system and use Python 3.6.x and I am not a beginner of python itself.
I looked up various pages on the internet, but I found nothing that helped me on that problem, my first problem was that the compiling didn't work but I already found that solution.
Edit: I tried to run the exe with the cmd and I get no output, instead I get a new line.
This is the setup code:
import sys
from cx_Freeze import setup, Executable
build_exe_options = {"excludes": ["tkinter"]}
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(name="Password",
version="1.0",
description="Generates a password made of 20 characters",
options={"build_exe": build_exe_options},
executables=[Executable("pass.py", base=base)])
And this is my program:
import random
import string
for i in range(20):
k = random.choice(string.ascii_letters)
j = random.randint(0, 9)
z = random.randint(1, 2)
if z == 1:
x = k
if z == 2:
x = j
print(x, end=" ")
I am grateful for any kind of insight.