Get serial number or XO name from command line or python

Henry Vélez Molina henry.laptop at gmail.com
Fri May 27 19:46:47 EDT 2011


Hi.

2011/5/27 LASKE, Lionel (C2S) <LLASKE at c2s.fr>

>
>
> Hi all,
>
>
>
> Is there a simple way to get the XO serial number and/or the XO name from
> the command line and/or from a python script ?
>

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 is an easier way with "subprocess.call". But with this script you can
catch the output and to use it, almost, as you wish.
I hope it helps you.

Regards

>
>
>                 Lionel.
>
> _______________________________________________
> Devel mailing list
> Devel at lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
>


-- 
Henry Vélez Molina
Administrador de red OLPC
Fundación MArina Orth
Tel :341 23 59
Móvil: 312 769 0169
www.fundacionmarinaorth.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20110527/50f85431/attachment.html>


More information about the Devel mailing list