Last active
January 19, 2017 16:38
-
-
Save carlsmith/cbf29a3b9764bebc0c7adcb93905c3d4 to your computer and use it in GitHub Desktop.
IPython line magic for launching a static fileserver. It uses Ruby as the Python fileserver sucks a bit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from IPython.core.magic import register_line_magic as line_magic | |
@line_magic | |
def fileserver(args): | |
path, port = args.split(" ") if args else (".", "8080") | |
os.system('ruby -run -ehttpd "{}" -p{}'.format(path, port)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment