Skip to content

Instantly share code, notes, and snippets.

View sljeff's full-sized avatar
🚩
Flag

Kind Jeff sljeff

🚩
Flag
View GitHub Profile
@sljeff
sljeff / video_to_audio.py
Created November 25, 2016 02:44
python. convert video to audio.
# coding: utf-8
import moviepy.editor as mp
import sys
def convert(video_file_name, audio_file_name=None):
if audio_file_name is None:
audio_file_name = video_file_name + '.mp3'
try:
clip = mp.VideoFileClip(video_file_name)
clip.audio.write_audiofile(audio_file_name)
@sljeff
sljeff / pip-upgrade-all-packages.py
Created October 8, 2016 00:51
pip upgrade all packages
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)