<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Dec 22, 2012 at 3:36 PM, Alexander Ranstam <span dir="ltr"><<a href="mailto:ranstam@gmail.com" target="_blank">ranstam@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
Im totally new to Python, and im using it on my Raspberry pi. I found a program that sends an email, and one that checks the temperature of my CPU, but i cant seem to combine the to into the funktion that i want, sending me the CPU temp via Email.<br>

<br>
The two programs work very well on their own, but this doesnt work.<br>
<br>
this works: server.sendmail(fromaddr, toaddrs, msg)<br>
but this doesnt: server.sendmail(fromaddr, toaddrs, cpu_temperature)<br>
<br>
despite the command "print cputemp" working in the same program.<br>
<br>
When i run the program i get the error:<br>
<br>
Traceback (most recent call last):<br>
  File "sendcpu.py", line 36, in <module><br>
    msg = cpu_temperature<br>
NameError: name 'cpu_temperature' is not defined<br>
<br>
Does anyone know why the program claims that cpu_temperature isnt defined, when it is?<br></blockquote><div><br></div><div>You should copy and paste the code here including the context around the error.  You say print cputemp works, but cpu_temperature is not defined.  They are spelled differently.  Start there <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanx!<br>
<span class="HOEnZb"><font color="#888888"><br>
//Alexander<br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Joel Goldstick<br>
</div></div>