(function(){
if(''){
if (prompt('请输入文章密码') !== ''){
alert('密码错误!');
history.back();
}
}
})();
var NexT = window.NexT || {};
var CONFIG = {
hostname: new URL('https://kechenhh.gitee.io').hostname,
root: '/',
scheme: 'Gemini',
version: '7.7.0',
exturl: false,
sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
copycode: {"enable":false,"show_result":false,"style":null},
back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
bookmark: {"enable":false,"color":"#222","save":"auto"},
fancybox: false,
mediumzoom: false,
lazyload: false,
pangu: false,
comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
algolia: {
appID: '',
apiKey: '',
indexName: '',
hits: {"per_page":10},
labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
},
localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
path: 'search.xml',
motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
};
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome: false,
isPost: true
};
Python打包成exe | 我的博客
.use-motion .brand,
.use-motion .menu-item,
.sidebar-inner,
.use-motion .post-block,
.use-motion .pagination,
.use-motion .comments,
.use-motion .post-header,
.use-motion .post-body,
.use-motion .collection-header { opacity: initial; }
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion .logo-line-before i { left: initial; }
.use-motion .logo-line-after i { right: initial; }
Python打包成exe
发表于
2020-01-17
更新于
2020-12-14
分类于
Python
安装 pyinstaller
1
pip install pyinstaller
运行
1
pyinstaller -F -w -i favicon.ico love.py
-i 图标
加上 -w 去掉黑窗口
附——pyinstaller打包参数说明:
-F, –onefile打包一个单个文件,如果你的代码都写在一个.py文件的话,可以用这个,如果是多个.py文件就别用
-D, –onedir打包多个文件,在dist中生成很多依赖文件,适合以框架形式编写工具代码,我个人比较推荐这样,代码易于维护-K, –tk在部署时包含 TCL/TK-a, –ascii不包含编码.在支持Unicode的python版本上默认包含所有的编码.-d, –debug产生debug版本的可执行文件-w,–windowed,–noconsole使用Windows子系统执行.当程序启动的时候不会打开命令行(只对Windows有效)-c,–nowindowed,–console使用控制台子系统执行(默认)(只对Windows有效)pyinstaller -c xxxx.pypyinstaller xxxx.py –console-s,–strip可执行文件和共享库将run through strip.注意Cygwin的strip往往使普通的win32 Dll无法使用.-X, –upx如果有UPX安装(执行Configure.py时检测),会压缩执行文件(Windows系统中的DLL也会)(参见note)-o DIR, –out=DIR指定spec文件的生成目录,如果没有指定,而且当前目录是PyInstaller的根目录,会自动创建一个用于输出(spec和生成的可执行文件)的目录.如果没有指定,而当前目录不是PyInstaller的根目录,则会输出到当前的目录下.-p DIR, –path=DIR设置导入路径(和使用PYTHONPATH效果相似).可以用路径分割符(Windows使用分号,Linux使用冒号)分割,指定多个目录.也可以使用多个-p参数来设置多个导入路径,让pyinstaller自己去找程序需要的资源–icon=<FILE.ICO>将file.ico添加为可执行文件的资源(只对Windows系统有效),改变程序的图标 pyinstaller -i ico路径 xxxxx.py–icon=<FILE.EXE,N>将file.exe的第n个图标添加为可执行文件的资源(只对Windows系统有效)-v FILE, –version=FILE将verfile作为可执行文件的版本资源(只对Windows系统有效)-n NAME, –name=NAME可选的项目(产生的spec的)名字.如果省略,第一个脚本的主文件名将作为spec的名字
注意:
在代码里面尽量不要用import,能from…..import….就尽量用这个,因为如果是import的话,在打包的时候,会将整个包都打包到exe里面,没有意义的增大了工具的大小!
pyinstaller打包的exe太大?你需要嵌入式python玄学 前提篇
python使用xmlrpc自动发布文章到wordpress
window.addEventListener('tabs:register', () => {
let activeClass = CONFIG.comments.activeClass;
if (CONFIG.comments.storage) {
activeClass = localStorage.getItem('comments_active') || activeClass;
}
if (activeClass) {
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
if (activeTab) {
activeTab.click();
}
}
});
if (CONFIG.comments.storage) {
window.addEventListener('tabs:click', event => {
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
let commentClass = event.target.classList[1];
localStorage.setItem('comments_active', commentClass);
});
}
一键复制
编辑
Web IDE
原始数据
按行查看
历史