问题
I have a python wheel package, when extracted I find some python code, I'd like to edit this code and re-generate the same .whl package again and test it to see the edits .. How do I do that?
回答1:
You usually don't.
Normally you get the source package instead of the wheel (or use development mode
to install the package in editable form) and rebuild the wheel from that, e.g. by running python setup.py bdist_wheel
.
Have a look at https://packaging.python.org/distributing/ for a lot of information how to build those wheel packages.
回答2:
Wheel provides the wheel
command in addition to just setup.py bdist_wheel
. Use wheel unpack [file.whl]
to open the wheel, edit what you will, and then use wheel pack [directory]
to put it back together again.
回答3:
you can open the whl file using 7zip or something alike, track the file you wish to change, open in edit mode, save it, next 7zip will popup a message saying something was modified and if you want the change to be saved, press yes and youre good to go.
remember to backup your original whl before doing it..
来源:https://stackoverflow.com/questions/41898424/how-to-edit-a-wheel-package-whl