As far as I understand, what you're trying to do is called not open
but execute
. So you could find more info about that by searching for "python execute file on Linux". Despite this, you are trying to execute a directory, not a file. So, here is an example of what I'd do:
import subprocess
subprocess.call(['/bin/ls', '-l'])
This will call the executable file ls
located at the /bin
folder and provide it with one argument: -l
. It will list files in your current directory (however, remember that you shouldn't use ls
for that purpose, this is just an example. If you want to list files in a directory, there are special functions for that in Python).
Speaking about file extensions, the executable file on Linux (similar to Windows' .exe file) is called an ELF file, which does not have a canonical extension. In fact, Linux in general cares about extensions much less, than Windows. If you want to know more about which else files can be executed on Linux, execute permissions etc, please, search for info on the internet and/or ask a question at https://superuser.com)