misOrz

IT Tech & Life

Encrypted Python source code

執行如下命令,即可將目錄下的所有.py文件編譯成.pyc文件:

python -m compileall

python -m compileall test.py

然後刪除 目錄下所有 .py 文件就可以了。

$ find -name '*.py' -type f -print -exec rm {} \;


這一方法,可以加密我們的Python代碼,勝過代碼裸在外面。尷尬的是,因為Python解釋器的兼容較差,有些版本並不能運行.pyc文件。而且已經有現成的反編譯工具,可以直接破解。


比如python-uncompyle6,只要執行以下命令,就可以搞定。

$ uncompyle6 *compiled-python-file-pyc-or-pyo*



Reference:https://kknews.cc/code/yv6a24n.html




How to install pip on Slackware Linux

1. Download install file:
https://slackware.pkgs.org/14.0/salix-i486/python-pip-1.2.1-i486-1fg.txz.html


  • wget http://download.salixos.org/i486/14.0/salix/d/python-pip-1.2.1-i486-1fg.txz
  • upgradepkg --install-new python-pip-1.2.1-i486-1fg.txz
  • pip

2. If you see the following message:












  • you can run easy_install --upgrade pip


3. If you see the following message:















  • you can run mv /usr/bin/lsb_release  /usr/bin/lsb_release.bak