I am using argparse
in a python file "hello.py"
I am executing this file using
python hello.py -infile "ex1.txt" -op1 "2" ....
How to get which directory "hello.py" file is located? I know that os.path.dirname()
can be used for infile
, but how to know the same thing "hello.py"?