Commit 8132584a authored by BorjaEst's avatar BorjaEst
Browse files

Added utils module for helper functions

parent fa154779
"""This module offers some utils for code management"""
from contextlib import contextmanager
import os
@contextmanager
def cd(newdir):
"""Changes the directory inside a 'with' context"""
prevdir = os.getcwd()
os.chdir(os.path.expanduser(newdir))
try:
yield
finally:
os.chdir(prevdir)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment