id: e36e678519f845409c94852932173c1e
parent_id: 
item_type: 1
item_id: 89009b7b97ac4d6d957b995665ca3649
item_updated_time: 1764345475717
title_diff: "[{\"diffs\":[[1,\"安卓termux折腾手记：安装Python库加tasker调用\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":31}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>安卓termux折腾手记：安装Python库加tasker调用</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"7456\\\"></a>\\\r\\\n<h1>安卓termux折腾手记：安装Python库加tasker调用</h1>\\\r\\\n\\\r\\\n<div>\\\n<span><div><br/></div><div style=\\\"min-width: 100%;\\\"><div style=\\\"vertical-align: baseline;\\\"><div style=\\\"vertical-align: baseline; text-align: left;\\\"><div style=\\\"margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 0px auto; padding: 0px 2em; border: 0px; vertical-align: baseline; z-index: 200; position: relative; width: 36em;\\\"><div style=\\\"margin: 0px 25px 0px -25px; padding: 0px; border: 0px; vertical-align: baseline; position: relative;\\\"><div style=\\\"margin: 0px; padding: 0px 0px 9em; border: 0px; vertical-align: baseline; position: relative;\\\"><div style=\\\"margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; position: relative;\\\"><div style=\\\"margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><h1 style=\\\"border: 0px; vertical-align: baseline; text-align: left; font-size: 35px; padding: 0px; margin: 0px;\\\"><span style=\\\"font-size: 35px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: normal; line-height: 35px;\\\">安卓termux折腾手记：安装Python库加tasker调用</span></h1><div style=\\\"padding: 1.5em 0px; border: 0px; font-size: inherit; vertical-align: baseline; position: relative; height: 1em; text-align: center; margin: 0px;\\\"><div style=\\\"padding:0px;border:0px;font:inherit;vertical-align:baseline;position:absolute;left:-4em;top:50%;z-index:10;width:100%;padding-left:4em;padding-right:4em;height:0.1em;opacity:0.5;background:-webkit-linear-gradient(0deg, rgb(243, 242, 238) 1%, rgb(31, 9, 9) 50%, rgb(243, 242, 238) 99%);margin:0px;margin-bottom:0px;\\\"></div></div></div><div style=\\\"margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"background-color: rgb(255, 250, 165); font-size: 12pt;-evernote-highlight:true;\\\">划重点：</span></div><ol><li><div style=\\\"margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"background-color: rgb(255, 250, 165); font-size: 12pt;-evernote-highlight:true;\\\">建立Tasker专用的目录</span></div></li></ol><div style=\\\"margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"background-color: rgb(255, 250, 165); font-size: 12pt;-evernote-highlight:true;\\\">        mkdir -p .termux/tasker</span></div><ol><li><div style=\\\"margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"background-color: rgb(255, 250, 165); font-size: 12pt;-evernote-highlight:true;\\\">Python Script 头一行加上下列代码，不然会被当成sh档执行，注意是python所在的目录</span></div></li></ol><div style=\\\"margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"background-color: rgb(255, 250, 165); font-size: 12pt;-evernote-highlight:true;\\\">        #!/data/data/com.termux/files/usr/bin/python</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><br/></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">一篇旧文，基于之前的知乎问答，加上了安装scipy/scikit-learn部分。实际上现在来看，安卓上用Qpython和Pydroid来操作python也不错，毕竟在手机上还是ide用着更舒服。Qpython的ipython notebook用着就很舒服，不需要在手机浏览器里使用了，再有就是android模块也有很多有用的功能。只可惜不支持Python3，另外很多库也没法安装。Qpython的话Python2/3都支持，pip几乎可安装所有的第三方模块，实在太强大了。要是能搞个类似于Qpython那种notebook，就简直太完美了。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">当然加上安卓上神器tasker的话就更好玩了，Qpython和termux这俩都提供了专门的插件可以进行交互，比如最简单的，做个定时爬虫之类。</span></div><div><br/></div><div><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 1.5em;\\\">1.termux简介</span></div></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">1.1 简介</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">termux是安卓手机上的一款软件，相当于在安卓上搭建了一个Linux平台，所以在Linux上能干的事情很多在手机上也都办得到，比如本文就是介绍与python相关的内容。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">实际上，得益于安卓平台的开放性，类似termux的手机神器着实不少。不说各类强大的编程IDE，单是termux这样的Linux平台类软件就很多，如GnuRoot系列，LinuxDisplay系列等。这其中termux很受人欢迎，对于我来说，其主要优点一是体积小，二是不需要root，三是网上能找到很多相关资源。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">除了termux之外，它还有一大群兄弟姐妹们（各种插件）可供大家挑选使用，如下所示。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 1em 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 1em 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; text-align: center;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\"><img src=\\\":/16df855b5ad349ddbba54ad2e319b61c\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-976840b98567cb6e43acdd6697aa5c56_r.jpg\\\" height=\\\"363\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;border-color:rgb(31, 9, 9);display:block;max-width:100%;\\\" width=\\\"576\\\"/></span></div><div style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">termux插件</span></div></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">1.2下载</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">官方给出了两个地址，一是Google Play，二是Fiord。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">这两个地方略有区别，安装包的签名是不同的。所以如果要和termux家族的其他软件联合使用的话，最好在同一个来源下载。其次在Google play有些额外的软件是付费应用，而Fiord上可以免费下载。</span></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">1.3 termux 初体验</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">打开termux后的界面如下，包括两部分。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 1em 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 1em 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; text-align: center;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\"><img src=\\\":/791a26859df74c5685ac07f17ee59d2b\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-1df6f9cd73f179535536deb41af170cf_r.jpg\\\" height=\\\"1024\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;border-color:rgb(31, 9, 9);display:block;max-width:100%;\\\" width=\\\"576\\\"/></span></div><div style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">termux首界面</span></div></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">1. 第一部分是termux官方网站和相关资源，实际上还有Github和Google Group。有啥问题到这些地方可以找到答案，像github和官方wiki就有很多资源可供进一步学习。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">2. 第二部分介绍了个包管理器命令pkg，给出了四个命令。最后的help是通用的，前面分别是搜索/安装/升级包。我理解跟linux的apt/apt-get, python的pip差不多，实际上直接用apt命令也可以的。</span></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2 安装python模块</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">我们开始在termux上配置python编程环境了。</span></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2.1 安装python</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">1. 安装python前首先更新安装包</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">apt update</span></div><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">apt upgrade</span></div></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">2. 安装python，目前模式最新版3.6.4。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">python-dev也装上，主要是有些第三方模块用得着。假如安装python2的话，把python改成python2就可以了。</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">pkg install python, python2</span></div><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">pkg install python-dev, python2-dev</span></div></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 1.5em;\\\">Note：</span><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">这里用的是pkg，按道理apt也可以，不过这次一开始我用apt报错了。</span></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2.2 安装科学计算包</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">作为爱学习的孩子，我们用python当然要搞一搞当前最热门的数据分析跟机器学习了。</span></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2.2.1 jupyter, numpy，matplotlib和pandas</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">方法来自这篇文章：</span><a href=\\\"https://link.zhihu.com/?target=https%3A//link.jianshu.com/%3Ft%3Dhttp%253A%252F%252Fwww.leouieda.com%252Fblog%252Fscipy-on-android.html\\\" style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; color: rgb(6, 85, 136); font-family: &quot;PT Serif&quot;; line-height: 1.5em; text-decoration: none;\\\" target=\\\"_blank\\\">Running Jupyter and the Scipy stack on Android</a></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">1. 安装这四个包，首先安装下依赖。</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">apt install python python-dev clang fftw libzmq libzmq-dev freetype freetype-dev libpng libpng-dev pkg-config</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">2. 正式安装包</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">这四个包安装方法类似，不过实际中安装时很多人会踩坑，其中jupyter是最容易安装的，一般没问题。安好了就可以拥有ipython和jupyter notebook两大神器了。</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">LDFLAGS=&quot; -lm -lcompiler_rt&quot; pip install jupyter</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">这里pip之前加了东西，看到网上说是链接到数学库编译的意思。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">剩下三个其中numpy是基础包，是pandas和matplotlib的依赖包，方法类似。</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">LDFLAGS=&quot; -lm -lcompiler_rt&quot; pip install numpy matplotlib pandas</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 1.5em;\\\">Note：</span> <span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">第一次一起安装，结果matplotlib部分报错。后来是先装numpy,再一起装pandas和matplotlib（termux可以开多个界面）成功了。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 1.5em;\\\">ipython和matplotlib</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">用ipython写代码可以使用各种魔法操作，termux里的界面看着也很漂亮，如下图所示</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 1em 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 1em 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; text-align: center;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\"><img src=\\\":/f7793b8e4035411d88fc7a940c52d9ab\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-61555f736ac80da6a61f30d217835bc9_r.jpg\\\" height=\\\"1024\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;border-color:rgb(31, 9, 9);display:block;max-width:100%;\\\" width=\\\"576\\\"/></span></div><div style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">termux/ipython界面</span></div></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">不过可以看到里面```import matplotlib.pyplot```报错了，主要是缺后端绘图界面支持。命令行作图确实也不大现实。但我们还是可以在手机上使用matplotlib的，毕竟还有jupyter notebook嘛。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">在jupyter notebook作图如下：</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 1em 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 1em 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; text-align: center;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\"><img src=\\\":/5132d9ff7f354c519aadc07e78359996\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-d60c7e3a96f3e6d9bca033b84ae4dd38_r.jpg\\\" height=\\\"1024\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;border-color:rgb(31, 9, 9);display:block;max-width:100%;\\\" width=\\\"576\\\"/></span></div><div style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">jupyter notebook in termux</span></div></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2.2.2 安装numpy，matplotlib可能遇到的问题</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">numpy，matplotlib可能在安装时可能会有问题，这个跟各个模块的版本号有关系。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">安装报错不妨多试几个版本。就是在最后加上版本号信息诸如``pip install numpy==1.12.1``` ```pip install matplotlib==1.2.0```</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">当然如果你还要一起安装下面两个模块的话，还可以有别的解决方法。</span></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2.2.3 安装scipy和scikit-learn</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">这里安装后一个scikit-learn需要先安装scipy。安装时要用到gcc来编译，不过从某版本开始termux官方版把gcc去除了。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">参照官方wiki和Github的大致安装方法如下：</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">1. 安装curl.</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">pkg install curl</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">2. 命令行输入以下命令</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">$ curl -L</span> <a href=\\\"https://link.zhihu.com/?target=https%3A//its-pointless.github.io/setup-pointless-repo.sh\\\" style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; color: rgb(6, 85, 136); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em; text-decoration: none;\\\" target=\\\"_blank\\\">https://its-pointless.github.io/setup-pointless-repo.sh</a> <span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">| sh</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">这里安装了一个叫gnupg的东西，链接到了termux社区一位贡献者(its-pointless)编译的源中，其中把numpy和scipy都包括进去了（这个源里还包括很多其他资源，如R，octove等）。也就是说这俩直接编译好了，只需要```pkg</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">install numpy, scipy``` 即可。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">Github里原话是这样的</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">This script essentially installs gnupg on your device and downloads and adds a public key to your apt keychain ensuring that all subsequent downloads are from the same source.</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">3. 上面已经说了，就是```pkg install numpy, scipy```</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">4.最后安装scikit-learn就很简单了，直接```pip install scikit-learn```就行。</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">假如前面那个方法按照numpy报错，可以采用该方法</span></blockquote><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2.3 爬虫模块安装</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">常见的几个比如requests，BeautifulSoup4，lxml，scrapy。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">前两个很简单，直接pip安装就行。后两个有一些依赖，而且安装scrapy前必须要先装lxml。</span></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">2.3.1 lxml，scrapy安装</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 1.5em;\\\">lxml</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">apt-get install libxml2 libxml2-dev libxslt libxslt-dev</span></div><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">pip install lxml</span></div></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 1.5em;\\\">scrapy</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">apt install python python-dev clang libffi libffi-dev openssl openssl-dev libxml2 libxml2-dev libxslt libxslt-dev</span></div><div><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;\\\">pip install scrapy</span></div></blockquote><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">3.termux/Tasker联合使用</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">前面提到有个apk叫termux-task可以用。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">安装这个apk应用即可，具体使用方法：</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">1. Tasker任务里添加插件&gt;termux:task，然后添加用termux编写的脚本了。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">2. 脚本放置位置是有要求的，就是要放到```~/.termux/tasker```文件夹里。需要在termux里创建该目录（如下代码所示），然后放入脚本就行。</span></div><blockquote style=\\\"font-size: inherit; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"font-size: 16px; background-color: rgb(255, 250, 165); color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-style: italic; line-height: 1.5em;-evernote-highlight:true;\\\">mkdir -p .termux/tasker</span></blockquote><div style=\\\"font-size: inherit; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; background-color: rgb(255, 250, 165); color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;-evernote-highlight:true;\\\">3. 这个跟文件系统有关系。比如```~/.termux```. ~ 表示 $HOME, 对于termux来说也就是这个路径 &quot;/data/data/com.termux/files/home&quot;.手机未root时 这个目录只有termux才有权限访问。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; background-color: rgb(255, 250, 165); transition: background-color 0.4s ease 0s; color: black; font-family: &quot;PT Serif&quot;; font-style: unset; line-height: 1.5em;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">4. 实际测试时发现，termux中的可执行程序开头必须加上声明行才可以使用，不然都是当成sh脚本运行的。比如对于python文件，开头要加上一行：</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; background-color: rgb(255, 250, 165); transition: background-color 0.4s ease 0s; color: black; font-family: &quot;PT Serif&quot;; font-style: unset; line-height: 1.5em;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">#!/data/data/com.termux/files/usr/bin/python</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; background-color: rgb(255, 250, 165); transition: background-color 0.4s ease 0s; color: black; font-family: &quot;PT Serif&quot;; font-style: unset; line-height: 1.5em;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">5. python程序中有文件操作时，没办法直接写一个相对路径，写上绝对路径是可以的。</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; background-color: rgb(255, 250, 165); transition: background-color 0.4s ease 0s; color: black; font-family: &quot;PT Serif&quot;; font-style: unset; line-height: 1.5em;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">比如之前提到的```.termux/tasker```文件夹中的xxx.py，</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; background-color: rgb(255, 250, 165); transition: background-color 0.4s ease 0s; color: black; font-family: &quot;PT Serif&quot;; font-style: unset; line-height: 1.5em;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">假如程序中有个写入文件```data/xxx.csv```，要换成下面的绝对路径：</span></div><blockquote style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em 2em; padding: 0px 0px 0px 1em; border-width: 0px 0px 0px 5px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-color: initial; border-image: initial; vertical-align: baseline; quotes: none; border-left-style: solid;\\\"><span style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; background-color: rgb(255, 250, 165); transition: background-color 0.4s ease 0s; color: black; font-family: &quot;PT Serif&quot;; font-style: unset; line-height: 1.5em;-evernote-highlight:true;\\\" title=\\\"点击以取消高亮显示\\\">/data/data/com.termux/files/home/.termux/tasker/data/xxx.csv</span></blockquote><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">如下图，为Tasker中添加Termux脚本的界面，这里添加了一个py脚本，选择在termux中运行</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 1em 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 1em 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; text-align: center;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\"><img src=\\\":/37a36bdd07214cef8bd000dee75aa487\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-7e7efa9b6cda4900c865e30c20a48574_r.jpg\\\" height=\\\"1024\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;border-color:rgb(31, 9, 9);display:block;max-width:100%;\\\" width=\\\"576\\\"/></span></div><div style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">Tasker添加termux脚本</span></div></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">下图即为茅台商城爬虫脚本的执行界面</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 1em 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><div style=\\\"margin: 1em 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; text-align: center;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\"><img src=\\\":/d5d099a16185409a8677e2fa0907a0e5\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-d879be6450699cc61046ca233839a017_r.jpg\\\" height=\\\"1024\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;border-color:rgb(31, 9, 9);display:block;max-width:100%;\\\" width=\\\"576\\\"/></span></div><div style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">脚本运行结果</span></div></div><h2 style=\\\"font-size: 30px; background-color: transparent; margin: 35px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; text-align: left;\\\"><span style=\\\"font-size: inherit; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; font-weight: bold; line-height: 35px;\\\">4.相关资源</span></h2><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline;\\\"><a href=\\\"https://link.zhihu.com/?target=https%3A//link.jianshu.com/%3Ft%3Dhttps%253A%252F%252Fwiki.termux.com%252Fwiki%252FMain_Page\\\" style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; color: rgb(6, 85, 136); font-family: &quot;PT Serif&quot;; line-height: 1.5em; text-decoration: none;\\\" target=\\\"_blank\\\">Termux Wiki</a></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><a href=\\\"https://link.zhihu.com/?target=https%3A//link.jianshu.com/%3Ft%3Dhttps%253A%252F%252Fgithub.com%252Ftermux%252Ftermux-app\\\" style=\\\"margin: 0px; padding: 0px; border: 0px; font-size: inherit; vertical-align: baseline; color: rgb(6, 85, 136); font-family: &quot;PT Serif&quot;; line-height: 1.5em; text-decoration: none;\\\" target=\\\"_blank\\\">termux in Github</a></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><br/></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;\\\"><br/></div></div></div></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px 0px 1.5em; padding: 0px; border: 0px; vertical-align: baseline; position: absolute; top: -1000px; left: -1000px;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1.5em;\\\">Measure</span></div><div style=\\\"font-size: inherit; background-color: transparent; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; position: absolute; top: -1000px; left: -1000px;\\\"><span style=\\\"font-size: 16px; color: rgb(31, 9, 9); font-family: &quot;PT Serif&quot;; line-height: 1;\\\">Measure</span></div></div></div></div></div></div></div></div><div><br/></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":44507}]"
metadata_diff: {"new":{"id":"89009b7b97ac4d6d957b995665ca3649","parent_id":"061de1401cfc4cfaadf6e74e015970e9","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764345867198,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T16:20:23.518Z
created_time: 2025-11-28T16:20:23.518Z
type_: 13