1 Star 0 Fork 1

Walkline / MicroPython File Tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

MicroPython File Tools

介绍

简易文件操作类工具,仅适用于MicroPython(并且只在ESP32下测试过)

命令列表

命令 说明
cat 查看文件内容
rm 删除文件或文件夹 (未实现)
ls 列出目录下的文件 (未实现)

cat 命令

原型:cat(filename, ln)

说明:查看文件内容

参数

  • filename:文件名
  • ln:是否显示行号,默认 True

rm 命令

ls 命令


工具使用方法

假设项目保存在/tools文件夹下,目录树如图所示:

...
├─tools
│    ├─__init__.py
│    ├─cat.py
│    ├─ls.py
│    └─rm.py
...

/tools文件夹连同你的项目文件一起下载到开发板,进入repl模式输入命令

>>> from tools import *
Walkline's Tools
>>> cat("boot.py")
1       # This file is executed on every boot (including wake-boot from deepsleep)
2       import esp
3       esp.osdebug(None)
4       #import webrepl
5       #webrepl.start()

项目使用说明

普通方法

可以直接下载项目压缩包,解压缩放入你的项目指定目录(如/tools)即可,缺点是本项目更新后需要重新下载并覆盖原文件

子模块方法

使用子模块方式加入到你的项目中,简单操作说明如下:

  • 添加子模块

     cd your_project/
     git submodule add --force https://gitee.com/walkline/micropython-file-tools.git tools
     git add .gitmodules tools
     git commit -m "add tools submodule"
     git push
  • 更新子模块

     cd your_project/tools/
     git checkout master
     git pull
     cd ..
     git add tools
     git commit -m "update tools submodule"
     git push

    此操作有待核实

  • 删除子模块

     cd your_project/
     git rm --cached tools
     rm -rf tools
     rm .gitmodules
     vim .git/config
     # 打开 config 文件后
     # 删除 [submodule "tools"] 相关内容
     # 保存后退出
     git add .
     git commit -m "remove tools submodule"
     git push
MIT License Copyright (c) 2020 Walkline Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

简易文件操作类工具 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/walkline/micropython-file-tools.git
git@gitee.com:walkline/micropython-file-tools.git
walkline
micropython-file-tools
MicroPython File Tools
master

搜索帮助