Skip to content

Instantly share code, notes, and snippets.

@lukifer195
Created July 30, 2020 07:54
Show Gist options
  • Save lukifer195/4330359b8236968874e719937ad6c789 to your computer and use it in GitHub Desktop.
Save lukifer195/4330359b8236968874e719937ad6c789 to your computer and use it in GitHub Desktop.
khung installer python
#!/usr/bin/python
#-*- coding:utf-8 -*-
################### EDIT ############################################
block_cipher = None
name = 'Lock' # <o> Name exe
path = 'D:\\Desktop\\PyProject\\Linh tinh\\Lock Folder project\\one file lock\\Lock.py' # <o> Path .py
shell = True # <o> console appear
iconname = 'icon.ico' # name icon make sure type .ico
data = [(iconname,'D:\\Downloads\\icon\\'+iconname,'DATA')] # change path icon if need
#####################################################################
a = Analysis([path], #path
pathex=[ # if import error
'C:\\Python\\Python36\\Lib\\',
'C:\\Python\\Python36\\libs\\',
'C:\\Python\\Python36\\ucrt\\DLLs\\x64',
],
binaries=[
# 'C:\\Python\\Python36\\ucrt\\DLLs\\x86'
],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
a.datas += data #icon
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=name, #name
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=shell, #Shell
icon=data[0][1]
)
# -*- mode: python -*-
from kivy.deps import sdl2, glew
block_cipher = None
a = Analysis(['face.py'],
pathex=['c:\\Users\\Home\\PycharmProjects\\MSICheck\\Images'],
binaries=None,
datas=None,
hiddenimports=['sqlite3','kivy.app','six','packaging','packaging.version','packaging.specifiers'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='face',
debug=True,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,Tree('c:\\Users\\Home\\PycharmProjects\\MSICheck\\Images\\'),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
name='face')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment