python 命令行版todolist
来源:互联网 发布:卖家怎么加入淘宝直播 编辑:程序博客网 时间:2024/06/05 20:10
图
最近作业很多,做了一个小工具。很简单的todolist,先上效果图:
最重要的代码
python2.7环境,没有其他依赖。
#!/usr/bin/env python#-*-coding:utf8-*-lists = []with open('todo.list','r+') as todo: lists = todo.readlines() for l in lists: print lin_put = raw_input('输入序号完成任务,q退出:')if in_put == 'q': exit()else: new_lists = [] i = 0 for l in lists: i += 1 if in_put == str(i): l = l.strip('\n')+'----已完成\n' new_lists.append(l) else: new_lists.append(l) with open('todo.list','w+') as todo: todo.writelines(new_lists)
阅读全文
0 0
- python 命令行版todolist
- todolist
- 【ToDoList】
- TODOList
- ToDoList
- TODOList
- ToDoList
- todolist
- TODOList
- ToDoList
- todolist
- ToDoList
- TODOlist
- react+redux的升级版todoList
- Python命令行
- python命令行
- Python 实现有道翻译命令行版
- Android学习小Demo(10)ToDoList的加强版
- 整数排序
- Excel合并多个工作表(Sheet)到一个Sheet中脚本
- 饥饿与活锁
- 深入理解javascript原型和闭包(3)——prototype原型
- Brocade HP SAN 交换机产品对应表
- python 命令行版todolist
- 内存溢出和内存泄露分析
- 位运算符
- IDEA 2017.1 基于Maven的web项目工程配置
- 1348 [BA1000] The Student Class with Public Data Fields
- 使用 Hibernate 二级缓存的步骤
- Log4j 2 同时输出日志到控制台和文件
- zetcd:脱离ZooKeeper运行ZooKeeper应用程序
- 运算符求最小最大值