2024. 9. 11. 22:08ใComputer Info./๐ Python
PyInstaller๋ฅผ ํตํด ์๋์ฐ ์คํ ํ์ผ์ ๋ง๋ค๋ ค๊ณ ํ๋๋ ์์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค. ์ด ๋ฌธ์ ๋ Python 3.10 ๋ฒ์ ์ ์๋ ์ด์๋ผ๊ณ ํ๋ค.
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ ํ์ด์ฌ์ด ์ค์น๋์ด์๋ ํด๋์ Lib ํด๋๋ก ์ด๋ํ๋ค. ๋ง์ฝ ์ค์น ํด๋๋ฅผ ์ ์ ์๋ค๋ฉด ํ๋กฌํํธ ์ฐฝ์ ์ด์ด์ ํ์ด์ฌ ๋ํํ ์ธํฐํ๋ฆฌํฐ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ค.
C:\Windows\System32>python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'C:\\Users\\sin00\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
>>>
์์ ๊ฐ์ด ํ์ด์ฌ์ด ์ค์น๋์ด์๋ ๊ฒฝ๋ก๋ฅผ ๋ณด์ฌ์ค๋ค.
์์ ๊ฒฝ๋ก์์ Python310\\Lib ์์ ์๋ dis.py ํ์ผ์ ์ด์ด def _unpack_opargs ๋ฉ์๋๋ฅผ ๊ฒ์ํ๋ค.
๊ทธ ํ ์ด ํจ์๋ฅผ ์์ ๊ฐ์ด ์์ ํ๋ค.
def _unpack_opargs(code):
extended_arg = 0
for i in range(0, len(code), 2):
op = code[i]
if op >= HAVE_ARGUMENT:
arg = code[i+1] | extended_arg
extended_arg = (arg << 8) if op == EXTENDED_ARG else 0
else:
arg = None
extended_arg = 0
yield (i, op, arg)
๊ทธ ํ ๋ค์ PyInstaller๋ฅผ ์คํํ๋ฉด ์์ ๊ฐ์ด ๋ฌธ์ ์์ด ์์ฑ๋๋ค.