I really need a list out of a system call such as os.system('ls ' + input) I've tried googling of course, but didn't find much.
Also tried different ways of coding it but I cannot get it to work.
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 '~/'.
Obviously I would greatly appreciate it if somebody could give me a hand with this problem.
Thanks.