|
2016-08-13
, 15:58
|
|
Posts: 141 |
Thanked: 1,530 times |
Joined on May 2011
@ Finland
|
#2
|
$ python3 Python 3.4.3 (default, May 12 2016, 02:20:34) [GCC 4.8.3 20140106 (Mer 4.8.3-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import platform >>> platform.platform() 'Linux-3.4.108.20160401.1-armv7l-with-glibc2.4' >>> platform.uname() uname_result(system='Linux', node='Sailfish', release='3.4.108.20160401.1', version='#1 SMP PREEMPT Thu May 12 02:21:45 UTC 2016', machine='armv7l', processor='armv7l')
|
2016-08-13
, 16:23
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#3
|
Maybe something in platform? Sailfish below, I don't know what others return.
Checking for the existance of a particular file or directory with os.path.isfile/isdir should be quite simple too if you know what to check -- e.g. /usr/lib/qt5/qml/Sailfish.Code:$ python3 Python 3.4.3 (default, May 12 2016, 02:20:34) [GCC 4.8.3 20140106 (Mer 4.8.3-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import platform >>> platform.platform() 'Linux-3.4.108.20160401.1-armv7l-with-glibc2.4' >>> platform.uname() uname_result(system='Linux', node='Sailfish', release='3.4.108.20160401.1', version='#1 SMP PREEMPT Thu May 12 02:21:45 UTC 2016', machine='armv7l', processor='armv7l')
And in case you're calling executables like notify-send, you can check if they're available with shutil.which.
If you want to support my work, you can donate by PayPal or Flattr
Projects no longer actively developed: here