1

My Delphi program uses Python4Delphi, and the Python script uses some standard libs. When deploying my program I don't want an entire Python installation, and it must work with python27.dll. What are the minimal set of necessary files? The document in Python4Delphi is dated and it's not clear to me...

Thanks for your help.

ain
  • 22,394
  • 3
  • 54
  • 74
Edwin Yip
  • 4,089
  • 4
  • 40
  • 86

1 Answers1

1

When I did this, I made the list myself, of what I needed for my embedded python application to work.

I remember this worked with python15.dll:

  1. PythonXX.dll should work, without any other external files other than the Visual C++ Runtime DLLs, which require a side-by-side manifest (see the p4d wiki page) to work.

  2. If you want to IMPORT something, then you need to ship it and anything it depends on. That means, either you pick part of the python standard libraries you want, or you pick all of it. There is no way you need all of Python's standard libraries. But I wouldn't want to live without OS and a a few other key ones. BUt the decision is yours.

Warren P
  • 65,725
  • 40
  • 181
  • 316
  • What about registry settings, environment variables? Do you need to do anything there? What about the licence? Note, this is asked out of curiosity and a concern that there is missing detail. No criticism here. – David Heffernan Sep 17 '11 at 21:39
  • Python (especially when embedded as in this case) doesn't need any registry settings or environment variables to run. If you want to write code in python that reads the registry; Python does not ship with Win32 bindings to read the registry. For that you want the PyWin32 add-on available here: http://sourceforge.net/projects/pywin32/ However in the case of python4delphi, you might want to abstract configuration away from your scripting users and instead provide your own functions to read your app's configuration (you write it in delphi and expose that API to be called by Python). – Warren P Oct 17 '11 at 13:25