Here is the line that needs to be shortened.
tree_top = os.path.abspath(os.path.expanduser(os.path.expandvars(sys.argv[1])))
os.path,abspath
, os.path.expandvars
and os.path.expanduser
to have shorter names?The easiest way to reduce the width is to use implicit line continuation within parentheses:
tree_top = os.path.abspath(
os.path.expanduser(
os.path.expandvars(sys.argv[1])
)
)
Alternatively, just select the parts of os.path
that you need:
from os.path import abspath, expanduser, expandvars
tree_top = abspath(expanduser(expandvars(sys.argv[1])))
or use some combination of the two.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With