May-06-2017, 05:36 PM
(This post was last modified: May-06-2017, 07:10 PM by sparkz_alot.)
I've converted a python script to an exe file, whenever I open the exe the program runs fine and it will ask for user input. But when I do so and press enter it will close the window right away, which didn't happen when it was still a .py file.
When I converted the py file I did get some errors but it seemed python solved those by itself(3 missing modules):
This is actually the first program I created. So I might miss something?
When I converted the py file I did get some errors but it seemed python solved those by itself(3 missing modules):
Output:C:\Python34>python.exe C:\xampp\htdocs\thchchall\install.py install
running install
running build
running install_egg_info
Removing C:\Python34\Lib\site-packages\UNKNOWN-0.0.0-py3.4.egg-info
Writing C:\Python34\Lib\site-packages\UNKNOWN-0.0.0-py3.4.egg-info
C:\Python34>python.exe C:\xampp\htdocs\thchchall\install.py py2exe
running py2exe
3 missing Modules
------------------
? readline imported from cmd, code, pdb
? win32api imported from platform
? win32con imported from platform
Building 'dist\test2.exe'.
Building shared code archive 'dist\library.zip'.
Copy c:\windows\system32\python34.dll to dist
Copy C:\Python34\DLLs\select.pyd to dist\select.pyd
Copy C:\Python34\DLLs\_lzma.pyd to dist\_lzma.pyd
Copy C:\Python34\DLLs\_bz2.pyd to dist\_bz2.pyd
Copy C:\Python34\DLLs\_hashlib.pyd to dist\_hashlib.pyd
Copy C:\Python34\DLLs\_ssl.pyd to dist\_ssl.pyd
Copy C:\Python34\DLLs\pyexpat.pyd to dist\pyexpat.pyd
Copy C:\Python34\DLLs\unicodedata.pyd to dist\unicodedata.pyd
Copy C:\Python34\DLLs\_socket.pyd to dist\_socket.pyd
Copy C:\Python34\DLLs\_ctypes.pyd to dist\_ctypes.pyd
What causes this behavior?This is actually the first program I created. So I might miss something?
from array import array import random aKeys = ['wctojxl9gmk8frn','ftzdr4he7ek8a4b','qiwh4yqshtescu6','uh1wdtv7tcjjv98','8cg2202d4zk49tn','ypnqgyldfxweht3','1eqxsz9rlw6swh2','bne3mw7wyapn3is','m1yuwlmxjypodb9','11pqogqvap0z8a2','v3x4lukfq0vlm37','5d0dnyjad1qeoo1','5juzdllxl1lfals','vtsl5eepzsg6sqo','y6u7veu4g6f6lwo','o2b861q2wvshgqi','x7lqey814xl0efz','r6x1r6g6dj3odbw','qyazpwvisijyofq','474zektqgztqxb6','net0n1rqkoy0285','ozrte2g2dt32y23','3qmfvwm21drn8z6','n27brwj9u9i3fjs','7qc5sbtqcq50qv6','jiexqjvhf7hkec7','uxmnvnc9yqqiads','o4930haengedirh','kduc5f59bhcjwcz','6eqoaxmwtcuhq2t'] def GeneratePass(aKeys): sStringX = "" iTemp = random.randint(0,len(aKeys[0])-1) for x in range(0,len(aKeys)): if(x!=0 and x%5==0): sStringX += "-" if(aKeys[x][iTemp].isalpha()): sStringX += aKeys[x][iTemp].upper() elif(aKeys[x][iTemp].isnumeric()): sStringX += aKeys[x][iTemp] return sStringX def IsValid(sKey,aKeys): if(sKey==''): return(False) if(len(sKey)!=35): return(False) sKey = sKey.lower() sKey = sKey.replace("-","") for x in range(0,len(aKeys[0])): if(aKeys[0][x]==sKey[0]): for y in range(0,len(aKeys)): if(aKeys[y][x]!=sKey[y]): return (False) return (True) return (False) sInput = input("Please enter a serial number:\n") if(IsValid(sInput,aKeys)): print("Correct") else: print("Invalid")