I want to open the files in a directory with the following specific file types entered by users:
if type is not None:
for file in glob.glob(dir + "/" + type):
if os.path.isfile(file):
open_file(file)
if os.path.isdir(file):
open_folder(file)
Type is "t" as an argument parser variable standing for file types, D is dir:
$ python scan.py -D /home/ -t .php
But it just gives an empty output rather than an expected result with .php files.