Skip to content

Instantly share code, notes, and snippets.

View stonebig's full-sized avatar

stonebig

  • France
View GitHub Profile
@stonebig
stonebig / updateExecutableIcon.py
Created August 18, 2024 10:20 — forked from flyx/updateExecutableIcon.py
Updates the icon of a windows executable file.
import win32api, win32con
import os, os.path
import struct
import math
def checkPath(path, mode):
if not os.path.exists(path) or not os.path.isfile(path):
raise ValueError("{0} does not exist or isn't a file.".format(path))
if not os.access(path, mode):
raise ValueError("Insufficient permissions: {0}".format(path))