Start save script
This commit is contained in:
commit
495751b00c
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.pyc
|
||||||
|
__pycache__
|
||||||
|
.DS_Store
|
16
save.py
Executable file
16
save.py
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Get arguments
|
||||||
|
parser = argparse.ArgumentParser(description="Save reddit posts to file.")
|
||||||
|
parser.add_argument("mode", type=str, nargs=1, choices=["saved", "upvoted"], help="The file to convert.")
|
||||||
|
parser.add_argument("location", type=str, nargs=1, help="The path to save to.")
|
||||||
|
args = parser.parse_args()
|
||||||
|
mode = args.mode[0]
|
||||||
|
location = args.location[0]
|
||||||
|
|
||||||
|
# Is location specified a directory?
|
||||||
|
if not os.path.isdir(location):
|
||||||
|
print(location, "is not a directory")
|
Loading…
Reference in New Issue
Block a user