I'd like to pass shell input to a variable in python. Normally I would use the raw_input()
method for this, but I'd like to use something which allows me to "browse" through my folders.
In a bash script I'd use something like this: (The -e allows me use the "autocomplete" function of the shell via Tab.)
#!/bin/bash
echo Please input the path to the file:
read -e var
echo $var
Does anyone know how to solve this in Python? I looked at os.popen()
and os.system()
but cannot figure out how to use them.