Hi.<br><br><div class="gmail_quote">2011/5/27 LASKE, Lionel (C2S) <span dir="ltr"><<a href="mailto:LLASKE@c2s.fr">LLASKE@c2s.fr</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">






<div lang="FR" link="blue" vlink="purple">
<div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span lang="EN-US">Hi all,</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">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 ?</span></p></div></div></blockquote><div><br></div><div>Also you could use this script:</div>
<div><br></div><div>_ _ _</div><div><div><font class="Apple-style-span" color="#666666">#!/usr/bin/python -tt</font></div><div><font class="Apple-style-span" color="#666666"><br></font></div><div><font class="Apple-style-span" color="#666666">import subprocess</font></div>
<div><font class="Apple-style-span" color="#666666"><br></font></div><div><font class="Apple-style-span" color="#666666">getserial = subprocess.Popen(['cat /ofw/serial-number'], shell=True, stdout=subprocess.PIPE)</font></div>
<div><font class="Apple-style-span" color="#666666"><br></font></div><div><font class="Apple-style-span" color="#666666">for line in getserial.stdout:</font></div><div><font class="Apple-style-span" color="#666666"><span class="Apple-tab-span" style="white-space: pre; "> </span>print(line.decode().strip()) </font></div>
</div><div>_ _ _</div><div><br></div><div>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.</div><div>I hope it helps you.</div><div>
<br></div><div>Regards</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="FR" link="blue" vlink="purple"><div>
<p class="MsoNormal"><span lang="EN-US"> </span></p><font color="#888888">
<p class="MsoNormal"><span lang="EN-US">                Lionel.</span></p>
</font></div>
</div>

<br>_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.laptop.org">Devel@lists.laptop.org</a><br>
<a href="http://lists.laptop.org/listinfo/devel" target="_blank">http://lists.laptop.org/listinfo/devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Henry Vélez Molina<br>Administrador de red OLPC<br>Fundación MArina Orth<br>Tel :341 23 59<br>Móvil: 312 769 0169<br><a href="http://www.fundacionmarinaorth.org">www.fundacionmarinaorth.org</a><br>