tw4ld6 发表于 2024-8-17 17:36:59

怎么样在手机上写Python--安卓篇 #程序员


    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Python编程:安卓写Python。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">写代码当然要在电脑上,毕竟打字方便,屏幕又大。但偏偏有人要在坐车、吃饭、上课、约会的时候写代码,于是我就会经常被问到:老师,能<span style="color: black;">不可</span>在手机上写Python?今天就给你们分享下安卓手机编写并运行Python代码的三个App。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">·1.QPython。应用商店可下载,<span style="color: black;">或</span>去QPython的项目主页<span style="color: black;">亦</span><span style="color: black;">能够</span>找到APK安装包。QPython的分支<span style="color: black;">非常多</span>,<span style="color: black;">平常</span>的有QPython基本版、QPython3、QPython plus。商店里的是基本版,学习用这个就<span style="color: black;">能够</span>。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-axegupay5k/ea7c37d62a43407f866be566ba93174a~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723893936&amp;x-signature=XT1Go52Vtdza6hCBaCi6TeQTP6k%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">日前</span>配套的Python版本是3.11plus的版本更新,支持<span style="color: black;">更加多</span>的<span style="color: black;">研发</span>权限,但这可能<span style="color: black;">亦</span>是它<span style="color: black;">没法</span>上架应用商店的<span style="color: black;">原由</span>,这权限弹窗弹到你<span style="color: black;">可疑</span>人生。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">QPython<span style="color: black;">供给</span>了<span style="color: black;">有些</span>预编译模块供安装,<span style="color: black;">重点</span>是数据分析、网络和人工智能方面。<span style="color: black;">倘若</span><span style="color: black;">无</span>你想要的,还<span style="color: black;">能够</span>尝试在命令行用pip命令进行安装。手机上不是所有的库都能用,<span style="color: black;">例如</span>内置的turtle、tkinter等GUI<span style="color: black;">关联</span>模块就不行。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">但QPython内置了SL4A,<span style="color: black;">亦</span><span style="color: black;">便是</span>安卓脚本语言环境。你<span style="color: black;">能够</span><span style="color: black;">经过</span>androidhelper这个模块去调用手机的摄像头、位置、蓝牙、短信等功能,<span style="color: black;">因此</span>四舍五入就约等于<span style="color: black;">能够</span>拿Python<span style="color: black;">研发</span>安卓应用了。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/36b76ef86671454c8573409274f81a06~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723893936&amp;x-signature=eX%2BEWK5D8%2BwYWyZLpYguiZtfafg%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">除了默认的编辑器,QPython<span style="color: black;">亦</span>支持Jupyter Notebook,<span style="color: black;">另一</span>还<span style="color: black;">供给</span>了FTP和扫描二维码的方式向手机上传代码,这还挺方便的。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">QPython安装配置五颗星,操作体验三颗星,功能模块四颗星,总体<span style="color: black;">评估</span>四颗星。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">·2.QPython。Pydroid3<span style="color: black;">无</span>上架国内的应用商店,<span style="color: black;">亦</span><span style="color: black;">无</span>官网<span style="color: black;">供给</span>下载,而我的手机<span style="color: black;">亦</span>没法<span style="color: black;">运用</span>GooglePlay,<span style="color: black;">因此</span>只能<span style="color: black;">经过</span>网上搜索安装包下载安装。<span style="color: black;">这般</span>带来的问题是可能下载到比较老的Python版本,又<span style="color: black;">或</span>不支持手机的硬件或系统。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/92e8093a17fc4c778b372043e6d45c4e~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723893936&amp;x-signature=Uaz1cGpQBwARg3VfeazoekPo98c%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">另一</span>当我下载了一个原版包安装后,<span style="color: black;">发掘</span>安装第三方模块时仍然要再连接Google Ply下载一个插件,这不又绕回去了吗?好在网上有<span style="color: black;">热情</span>人<span style="color: black;">供给</span>了汉化版和扩展插件,并内置了所有依赖。论操作体验,我个人觉得Pydroid3更加丝滑,<span style="color: black;">乃至</span>还<span style="color: black;">供给</span>了错误<span style="color: black;">检测</span>和代码提示。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p26-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/21fea9d101f94c0884bddba2fad09f45~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723893936&amp;x-signature=rlFgZ1PG5xyF%2FLItALBAGl2n0IQ%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在安装模块方面<span style="color: black;">一样</span><span style="color: black;">供给</span>了预制模块下载和命令行PIP安装两种方式。<span style="color: black;">针对</span>GUI和手机功能权限的支持,Pydroid3<span style="color: black;">供给</span>了Kiwy和PySide,<span style="color: black;">一样</span><span style="color: black;">能够</span>做出丰富的交互效果。让我比较意外的是,它居然对turtle、tkinter<span style="color: black;">这般</span>的Python内置GUI模块<span style="color: black;">亦</span>支持,<span style="color: black;">乃至</span><span style="color: black;">能够</span>写pygame,那不是直接就<span style="color: black;">能够</span>在手机上写Python游戏了?</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/e1e33f23d7674dc9abfcfa4845823c74~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723893936&amp;x-signature=5WKqZp%2B74O3QVmUDp46gq9fIpmw%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Pydroid3安装配置三颗星,操作体验四颗星,功能模块五颗星,总体<span style="color: black;">评估</span>四颗星。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">·3.Termux。Termux并不是为Python而生,它是一个安卓手机上的Linux终端,下载安装还算方便。官网<span style="color: black;">供给</span>了FULLY的和直接下载APK包两种方式,但安装完并<span style="color: black;">不可</span>直接写Python,还得在上面配置<span style="color: black;">研发</span>环境,这就要求<span style="color: black;">运用</span>者有<span style="color: black;">必定</span>的Linux<span style="color: black;">基本</span>,并且即便配置完成,纯<span style="color: black;">掌控</span>台的交互环境<span style="color: black;">亦</span><span style="color: black;">无</span>窗口化的代码编辑器<span style="color: black;">供给</span>给你。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/6a16747e130e4308b1be7ad2b38f5c5a~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723893936&amp;x-signature=RLtKSHPpLmeGXIosXtXy7aG7gb4%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">一种曲线救国的<span style="color: black;">方法</span>是在本地运行Jupyter Notebook,<span style="color: black;">而后</span>打开手机浏览器在里面写代码。<span style="color: black;">不外</span>很可惜,即使这种<span style="color: black;">方法</span>我<span style="color: black;">亦</span>没能安装成功。<span style="color: black;">做为</span>一个Linux环境<span style="color: black;">来讲</span>。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">·12-Termux是很强大的,<span style="color: black;">据述</span>还<span style="color: black;">能够</span>直接在里面重新安装一个Linux发行版。但<span style="color: black;">做为</span>一个手机上的Python<span style="color: black;">研发</span>环境,尤其是<span style="color: black;">针对</span>新手<span style="color: black;">来讲</span>实在是过于折腾。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">·12-Termux安装配置两颗星,操作体验两颗星,功能模块四颗星。总体<span style="color: black;">评估</span>两星半。</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/ee2e7db725154fafb825badb28ba728c~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1723893936&amp;x-signature=7lyz2XHuAij8CkE1F%2F%2FKXONERcc%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">总结一下,<span style="color: black;">针对</span>想在安卓手机上学习Python的<span style="color: black;">朋友</span><span style="color: black;">来讲</span>,QPython和Pydroid3都是不错的<span style="color: black;">选取</span>。Pydroid3与电脑版的兼容度更高,QPython则更方便一点,而Termux则更适合想学习Linux和服务器运维的<span style="color: black;">朋友</span>。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">本期视频就到<span style="color: black;">这儿</span>,点赞过500我会更新非安卓手机写Python的几种<span style="color: black;">方法</span>。<span style="color: black;">倘若</span>你有疑问<span style="color: black;">或</span>其他<span style="color: black;">举荐</span>,欢迎在评论区留言。</p>




情迷布拉格 发表于 2024-9-9 15:36:59

在遇到你之前,我对人世间是否有真正的圣人是怀疑的。

nqkk58 发表于 2024-9-30 17:07:49

软文发布论坛开幕式圆满成功。 http://www.fok120.com

j8typz 发表于 10 小时前

可以发布外链的网站 http://www.fok120.com/
页: [1]
查看完整版本: 怎么样在手机上写Python--安卓篇 #程序员