This TypeError: listdir() takes exactly 1 argument (0 given)
generally doesn't occur when you run the same command in Jupyter Notebook as path variables are already settled up when you launch a notebook. But you are running .py scripts you can sort it below way.
import os #importing library
path=os.getcwd() #will return path of current working directory in string form
a=os.listdir(path) #will give list of items in directory at <path> location same as bash command "ls" on a directory
Or you can manually give path as,
import os
path='/home/directory1/sub_directory'
a=os.listdir(path)
You can print a to checkout
print(a)