python에서 Pyinstaller를 사용하려면 Pyinstaller 모듈을 먼저 설치해야한다.
pip install pyinstaller
pyinstaller를 설치했다면, exe로 빌드할 파이썬이 있는 디렉토리로 이동한다
cd desktop
이동했다면 다음의 명령어로 exe 빌드를 할 수 있다.
pyinstaller --onefile 파일이름.py
이렇게 한다면 dist폴더 내에 파일이름.exe 파일이 생성된다.
만약, 내가 파이썬으로 gui를 구성했고 콘솔창이 뜨는 걸 없애고 싶다. 하면 -w라는 옵션을 추가하면 된다.
pyinstaller --onefile -w 파일이름.py
여기서 추가로 만약 내가 파일의 아이콘을 변경하고 싶다면 해당 디렉토리에 .ico파일을 배치하고 다음 명령어를 추가하면 된다.
pyinstaller --onefile -w --icon=아이콘이름.ico 파일이름.py
나는 주로 이곳에서 사진파일을 ico파일로 변환한다.
ICO Converter
Converts images to the ICO format for your websites or applications.
www.icoconverter.com
python에서 Pyinstaller를 사용하려면 Pyinstaller 모듈을 먼저 설치해야한다.
pip install pyinstaller
pyinstaller를 설치했다면, exe로 빌드할 파이썬이 있는 디렉토리로 이동한다
cd desktop
이동했다면 다음의 명령어로 exe 빌드를 할 수 있다.
pyinstaller --onefile 파일이름.py
이렇게 한다면 dist폴더 내에 파일이름.exe 파일이 생성된다.
만약, 내가 파이썬으로 gui를 구성했고 콘솔창이 뜨는 걸 없애고 싶다. 하면 -w라는 옵션을 추가하면 된다.
pyinstaller --onefile -w 파일이름.py
여기서 추가로 만약 내가 파일의 아이콘을 변경하고 싶다면 해당 디렉토리에 .ico파일을 배치하고 다음 명령어를 추가하면 된다.
pyinstaller --onefile -w --icon=아이콘이름.ico 파일이름.py
나는 주로 이곳에서 사진파일을 ico파일로 변환한다.
ICO Converter
Converts images to the ICO format for your websites or applications.
www.icoconverter.com