Мне действительно нужен список из системного вызова, такого как os.system ('ls' + input) Я, конечно, пробовал поиск в Google, но не нашел много.
Также пробовал разные способыкодирования, но я не могу заставить его работать.
import os
user_input = input("Specify directory: ")
directory = os.system('ls ' + str(user_input))
------------------------------------------------------------------
# I need a list made out of the directory variable.
# Also note that subprocessing doesn't work that well as it doesn't accept # bash special chars like '~/', whereas os.system() accepts that.
# What os.system(), subprocess.call() return is just a normal output and I # cannot get to list that.
# Also I have gotten my program to work with os.listdir() but os.listdir() # doesn't accept special chars like '~/'.
Очевидно, я был бы очень признателен, если бы кто-то мог помочь мне с этой проблемой.
Спасибо.