Skip to content

Commit 53084ff

Browse files
committed
Sys example.py
1 parent 7b43efd commit 53084ff

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

sys_example.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import sys
2+
import os
3+
4+
if len(sys.argv) == 1:
5+
print("Error. Not sufficient arguments")
6+
sys.exit(1)
7+
8+
if len(sys.argv) >= 1:
9+
file_name = sys.argv[1]
10+
if not os.path.isfile(file_name):
11+
with open(file_name, 'w') as f:
12+
f.write("Written file")
13+
14+
15+
# Create TODO App.
16+
# options will be
17+
# -a for add
18+
# -d delete the option.
19+
# -l for display
20+
# -u update a task
21+
# -t Time track
22+
# -h Help page
23+
# -v version
24+
# -tag Tag to the taks like [Office, Home, Sport]
25+
# IMPROVEMENT: Need to replace sys module with argparse.
26+
27+
# https://etherpad.openstack.org/p/python_todo
28+
# https://github.com/amolkahat/Python_Basics
29+
# https://pymbook.readthedocs.io
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+

0 commit comments

Comments
 (0)