How can I code a Python script that accepts a file as an argument and prints its full path?
E.g.
~/.bin/python$ ls
./ ../ fileFinder.py test.md
~/.bin/python$ py fileFinder.py test.md
/Users/theonlygusti/.bin/python/test.md
~/.bin/python$ py fileFinder.py /Users/theonlygusti/Documents/Online/theonlygusti.github.io/index.html
/Users/theonlygusti/Documents/Online/theonlygusti.github.io/index.html
So, it should find the absolute path of relative files, test.md
, and also absolute path of files given via an absolute path /Users/theonlygusti/Downloads/example.txt
.
How can I make a script like above?
No comments:
Post a Comment