python编译打包pyc脚本

1
2
3
4
5
6
7
cd $1
python3 -O -m compileall .
find . -name '*.pyc' -exec rename 's/.cpython-36.opt-1//' {} \;
find . -name '*.pyc' -execdir mv {} .. \;
find . -name '*.py' -type f -print -exec rm {} \;
find . -name '__pycache__' -exec rmdir {} \;
zip -r ../$1.zip ./*

转自:https://my.oschina.net/bfbd/blog/864310

技术博客 - 记录学习与思考
使用 Hugo 构建
主题 StackJimmy 设计