Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.05; 'context': 0.05; 'error:': 0.05; 'msg': 0.07; '22,': 0.09; 'defined,': 0.09; 'defined.': 0.09; 'differently.': 0.09; 'msg)': 0.09; 'nameerror:': 0.09; 'spelled': 0.09; 'cc:addr:python-list': 0.10; 'dec': 0.15; 'sat,': 0.15; '36,': 0.16; 'alexander': 0.16; 'doesnt': 0.16; 'isnt': 0.16; 'temp': 0.16; 'wrote:': 0.17; 'email addr:gmail.com>': 0.20; 'error.': 0.21; 'sends': 0.22; 'defined': 0.22; 'cc:2**0': 0.23; 'work.': 0.23; 'command': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '(most': 0.27; 'is?': 0.27; 'message-id:@mail.gmail.com': 0.27; 'run': 0.28; 'cpu': 0.29; 'url:mailman': 0.29; 'skip:& 10': 0.29; "skip:' 10": 0.30; 'checks': 0.30; 'code': 0.31; 'url:python': 0.32; 'file': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'received:74.125.82': 0.33; 'traceback': 0.33; 'anyone': 0.33; 'skip:& 20': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'there': 0.35; 'but': 0.36; 'received:74.125': 0.36; 'url:org': 0.36; 'totally': 0.36; 'should': 0.36; 'does': 0.37; 'two': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'url:mail': 0.40; 'subject:, ': 0.61; 'here': 0.65; 'want,': 0.65; 'email,': 0.66; 'cpu,': 0.84; 'temperature': 0.84; 'joel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=47rWCK1YGl7mPv/E0CRo0V306W3yfiOGfUsPwt10Qzs=; b=quKdDpLKncC+aZjUOlTY2UC3SqM/HalzLkvYDYL6aQ5Xye9hIqKQvEC5P4PH0UIU6c ZqHRNhVoIKWh+q7oSHOzsZaOOqauEPuTwe9+M3gBmG2N5StNhqtUbJU+sxCNHcLiZScF /lM4u9aOXacEYlQdw+8tUTe1jL5eo4Afiplvv4o7r9m8Gj8o/oZ5v4R/WkWnNttRmBhL END+qY5ioFTpYSqCED53O85iQTZP4EBp+7o/vzyCYUiCPVm9TIjKLdSjJ+wkNPIOhtdO B9aZ1F+/RpeFQ6zfFeoSYUgaPYyHpqoeh3sgQwqYofuNIC9521Gug66oTm1FNNBWprzB fFPw== MIME-Version: 1.0 In-Reply-To: <543ec063-14c1-4ca6-a911-ae6f58c22a8c@googlegroups.com> References: <543ec063-14c1-4ca6-a911-ae6f58c22a8c@googlegroups.com> Date: Sat, 22 Dec 2012 15:44:39 -0500 Subject: Re: Python, email temperature From: Joel Goldstick To: Alexander Ranstam Content-Type: multipart/alternative; boundary=bcaec53f397d6db2c504d17708e9 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 100 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356209086 news.xs4all.nl 6970 [2001:888:2000:d::a6]:41178 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35384 --bcaec53f397d6db2c504d17708e9 Content-Type: text/plain; charset=UTF-8 On Sat, Dec 22, 2012 at 3:36 PM, Alexander Ranstam wrote: > Hi! > > 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. > > The two programs work very well on their own, but this doesnt work. > > this works: server.sendmail(fromaddr, toaddrs, msg) > but this doesnt: server.sendmail(fromaddr, toaddrs, cpu_temperature) > > despite the command "print cputemp" working in the same program. > > When i run the program i get the error: > > Traceback (most recent call last): > File "sendcpu.py", line 36, in > msg = cpu_temperature > NameError: name 'cpu_temperature' is not defined > > Does anyone know why the program claims that cpu_temperature isnt defined, > when it is? > 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 > > Thanx! > > //Alexander > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick --bcaec53f397d6db2c504d17708e9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Sat, Dec 22, 2012 at 3:36 PM, Alexander Ranstam <ranstam@gmail.= com> wrote:
Hi!

Im totally new to Python, and im using it on my Raspberry pi. I found a pro= gram that sends an email, and one that checks the temperature of my CPU, bu= t i cant seem to combine the to into the funktion that i want, sending me t= he CPU temp via Email.

The two programs work very well on their own, but this doesnt work.

this works: server.sendmail(fromaddr, toaddrs, msg)
but this doesnt: server.sendmail(fromaddr, toaddrs, cpu_temperature)

despite the command "print cputemp" working in the same program.<= br>
When i run the program i get the error:

Traceback (most recent call last):
=C2=A0 File "sendcpu.py", line 36, in <module>
=C2=A0 =C2=A0 msg =3D cpu_temperature
NameError: name 'cpu_temperature' is not defined

Does anyone know why the program claims that cpu_temperature isnt defined, = when it is?

You should copy and paste t= he code here including the context around the error.=C2=A0 You say print cp= utemp works, but cpu_temperature is not defined.=C2=A0 They are spelled dif= ferently.=C2=A0 Start there

Thanx!

//Alexander

--
http://mail.python.org/mailman/listinfo/python-list



--
Joel Gold= stick
--bcaec53f397d6db2c504d17708e9--