Jan-30-2022, 08:10 AM
# fs.py from sys import argv script, filename = argv txt = open(filename) print(f"Here's your file {filename}:") print(txt.read()) print("Type the filename again:") file_again = input("> ") txt_again = open(file_again) print(txt_again.read())From command line i have two files in bar folder your code
fs.py
and test.txt
.Output:C:\code\bar
λ ls
fs.py test.txt
C:\code\bar
λ fs.py test.txt
Here's your file test.txt:
hello world
Type the filename again:
> test.txt
hello world
As you see the code is working.