Thursday, March 31, 2016

How to bundle httrack into a python 3 executable

Leave a Comment

There is a great website copier that I would like to bundle in my executable, created with python 3 and py2exe.
On the HTTrack official website in the FAQ section they say that there is a DLL/library version available.
But I don't know where to start, or even how to use the DLL once it would be bundled in the executable.
So how can I bundle httrack into a python 3 executable, and use its features to start copying websites?
Edit:
I found httrack-py 0.6.1 but it only supports python 2 and uses an old version of httrack, so I can't use this for my executable.

1 Answers

Answers 1

As I see it you have 2 options:

  1. You could try to convert httrack-py to python 3 following these instructions, but it's usually never a good idea to work with outdated and unmaintained 3rd party library.

  2. Since the official HTTrack provides you with DLL, you can use the library directly from python 3 code. A stackoverflow question How can I use a DLL file from Python? gives an excellent answer on how to do just that.

    The py2exe merely creates a windows installer which will take care of the details of installing python interpreter and your python code to the target system so that end user does not need to deal with anything else than just one .exe . This means you have to include 3rd party DLL's in the configuration - I would guess 3rd party DLL's to go into "data_files" (not tested this myself though).

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment