[maemo-developers] Identifying platform in Python code
From: Allan Doyle afdoyle at MIT.EDUDate: Mon Jun 4 19:13:48 EEST 2007
- Previous message: Identifying platform in Python code
- Next message: Identifying platform in Python code
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jun 4, 2007, at 12:00, Jeffrey Barish wrote:
> How do I determine in my code that I am running on the N800? Neither
> os.name nor sys.platform gets the job done. The former returns
> "posix",
> the latter "linux2", and I get the same strings when I run on Ubuntu.
You can parse it out of something like
import commands
id = commands.getoutput("uname -a")
if id has "Linux Nokia-N800" in it, it's an N800
if id has "Linux Nokia770" in it, it's a 770
This may change over time with newer versions of the OS but it works
for now.
--
Allan Doyle
http://museum.mit.edu/mwow
+1.781.433.2695
- Previous message: Identifying platform in Python code
- Next message: Identifying platform in Python code
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
