I have some file path in Python under Linux and I need to figure out if it's a block device - representation of disk or partition. This information is visible when typing ls -l, e.g.
brw-rw---- 1 root disk 8, 1 09-12 18:01 /dev/sda1
I mean letter b on start of this output. Is this possible to get something like this in Python using built in libraries? Eventually I can use subprocess to fetch "ls -l" result and check if first character is correct, but i feel that there could be nicer solution for this. Unfortunately I can't find this. Thanks.