1

I am looking at different ways of using python to make a dll. One suggestion I ran into was to use py2exe to compile the code to an exe and then rename it as a DLL and call it with the program. I have searched for other discussion as to whether this would work, and from what I have read it seems like you'd have to do more than just change the name and call it from another file, but I have not seen an explicit answer either way.

Obviously I'd like a little explanation as to why this can or cannot be done. What changes can you make to an EXE written like a DLL to make it a DLL? (like editing the PE header).

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
jeffpkamp
  • 2,732
  • 2
  • 27
  • 51
  • Not completely a duplicate because it's quite c++-specific, but http://stackoverflow.com/questions/1865631/c-loading-an-exe-as-a-dll-local-vftable-problem?rq=1 might be helpful? That is an interesting question. – neminem Jul 14 '14 at 21:01
  • I doubt it is even possible. I imagine that py2exe isn't creating entry points for your functions the way a C/C++ compiler does. – Sohcahtoa82 Jul 14 '14 at 21:17

0 Answers0