import pefile

pe = pefile.PE("GuessNumber.exe")

for entry in pe.DIRECTORY_ENTRY_IMPORT:
    print(entry.dll.decode())

    for imp in entry.imports:
        print("   ", hex(imp.address), imp.name)
