I am working on a larger script that walks through a directory structure to perform an action on each file.
I am having trouble figuring out how to pass the target directory as an argument in the command line (to be the starting point of the os.walk).
Can anyone advise on what I am doing wrong?
import os
import sys
def main():
for root, dirs, files in os.walk(sys.argv[1])
for item in files:
print(items)
if __name__ == '__main__':
main(sys.argv[1])