What am I doing incorrect in this directory search python code?

Advertisements What am I doing wrong in the following source code and how can I fix that? my_script.py import subprocess import os import time from pathlib import Path def get_files(dir_str): onlyfiles = next(os.walk(dir_str))[2] return onlyfiles input_files_path_str = "$HOME" def main(): input_files_list = get_files(input_files_path_str) print(input_files_list) if __name__=="__main__": main() Output: user_name@server_name:~$ python3 my_script.py Traceback (most recent call… Read More What am I doing incorrect in this directory search python code?