3 Commits
0.0.5 ... 0.0.6

Author SHA1 Message Date
ducoterra
d60a9f538d add start.sh 2020-11-09 21:21:40 -05:00
ducoterra
20fa53960d add day 2 to index 2020-11-09 21:21:05 -05:00
ducoterra
d58ebc1ebe add debug to convert 2020-11-09 21:20:58 -05:00
3 changed files with 21 additions and 7 deletions

View File

@@ -2,21 +2,27 @@ import subprocess
import os import os
import time import time
done_files = [] convert_dir = "/Users/ducoterra/Desktop/"
debug = False
while True: while True:
# get a list of all .mov or .gif files # get a list of all .mov or .gif files
movs = list(filter(lambda item: item.endswith(".mov"), os.listdir())) movs = list(filter(lambda item: item.endswith(".mov"), os.listdir(convert_dir)))
if debug:
print(f"Found {len(movs)} .mov files.") print(f"Found {len(movs)} .mov files.")
gifs = list(filter(lambda item: item.endswith(".gif"), os.listdir())) gifs = list(filter(lambda item: item.endswith(".gif"), os.listdir(convert_dir)))
if debug:
print(f"Found {len(gifs)} .gif files.") print(f"Found {len(gifs)} .gif files.")
# find files that are not already gifs and aren't default # find files that are not already gifs and aren't default
not_done = list(filter(lambda mov: mov.replace(".mov",".gif") not in gifs and not mov.startswith("Screen Recording"), movs)) not_done = list(filter(lambda mov: mov.replace(".mov",".gif") not in gifs and not mov.startswith("Screen Recording"), movs))
if debug:
print(f"Found {len(not_done)} to convert.") print(f"Found {len(not_done)} to convert.")
for mov in not_done: for mov in not_done:
print(f"converting {mov}. Ctrl + C to stop...") print(f"converting {mov}. Ctrl + C to stop...")
subprocess.run(['/usr/local/bin/ffmpeg', '-i', mov, '-filter:v', 'setpts=0.5*PTS', mov.replace(".mov",".gif")], capture_output=True) if debug:
time.sleep(5)
subprocess.run(['/usr/local/bin/ffmpeg', '-i', convert_dir + mov, '-filter:v', 'setpts=0.5*PTS', convert_dir + mov.replace(".mov",".gif")], capture_output=True)
time.sleep(1) time.sleep(1)

View File

@@ -15,3 +15,10 @@
- The Interactive Python Prompt - The Interactive Python Prompt
- A Python Program - A Python Program
- A Django Project
### [Day 2](day2.md): not, and, or, if
- Back to the basics: and, or, not, if
- Building a Terrible Weather App
- Pulling it all together with some Django

1
start.sh Executable file
View File

@@ -0,0 +1 @@
mkdocs serve -a localhost:8080