popd

@popd decorator. restore previous current directory


Keywords
popd, python
License
Unlicense
Install
pip install popd==2020.12.3

Documentation

Installation

$ [sudo] pip install popd

Examples

import popd

@popd.popd
def func():
    os.chdir('/tmp')
    print(os.getcwd())
>>> os.getcwd()
'/Users/username'
>>> func()
'/tmp'
>>> os.getcwd()
'/Users/username'

readme42.com