Hi all,
Thanks for all your answers. The serial was exactly what I expected. Great.
About the "XO name", my question was not clear. What I'm looking for is the
name in the Sugar Control Panel (Me).
Any way to get it ?
Regards.
Lionel.
-----Message d'origine-----
De : Chris Ball [mailto:[email protected]]
Envoyé : samedi 28 mai 2011 04:05
À : Henry Vélez Molina
Cc : LASKE, Lionel (C2S); [email protected]
Objet : Re: Get serial number or XO name from command line or python
Hi,
On Fri, May 27 2011, Henry Vélez Molina wrote:
> Also you could use this script:
>
> #!/usr/bin/python -tt
> import subprocess
> getserial = subprocess.Popen(['cat /ofw/serial-number'], shell=True,
> stdout=subprocess.PIPE)
> for line in getserial.stdout:
> print(line.decode().strip())
There's no need to spawn a shell, and then spawn cat inside a shell.
Python knows how to open files:
print open("/ofw/serial-number").readline().strip()
--
Chris Ball <[email protected]> <http://printf.net/>
One Laptop Per Child
_______________________________________________
Devel mailing list
[email protected]
http://lists.laptop.org/listinfo/devel