folks,
I'm trying to print a variable value, in this case it should be the command line argument given using Python 3.8.5.
--> code:
#!/usr/bin/python3
# import sys to open the file as command line argument
import sys
import pathlib
# open input file given in command line argument
with open(sys.argv[1], 'r') as ipfi:
print(f"{ipfi}")
--> run:
# ./test2.py kern.log.1
--> output:
<_io.TextIOWrapper name='kern.log.1' mode='r' encoding='UTF-8'>
--> expected (desired) output:
kern.log.1
Tried several print options so far... Any hints on that? Thanks in advance.