dotfiles
Something went wrong. Try again.
1234567891011121314151617181920import datetime as dtfrom pathlib import Path
c = get_config()
# The name of the logfile to use.logfile_dir = Path('~/projects/ipython-logs').expanduser()logfile_dir.mkdir(parents=True, exist_ok=True)now = dt.datetime.now().astimezone()logfile_fn = logfile_dir / f'automatic-log--{now:%Y-%m-%dT%H-%M-%Z}.py'# make sure file existslogfile_fn.touch()
# set the logfilec.TerminalInteractiveShell.logfile = str(logfile_fn)
# Start logging to the default log file.c.TerminalInteractiveShell.logstart = True