Getting started with IDLE and Python - no highlighting and no execution

Matthew Barnett mrabarnett at mrabarnett.plus.com
Sun Aug 5 21:01:47 EDT 2012


On 06/08/2012 01:58, MRAB wrote:
> On 06/08/2012 01:09, Rotwang wrote:
>> On 06/08/2012 00:46, PeterSo wrote:
>>> I am just starting to learn Python, and I like to use the editor
>>> instead of the interactive shell. So I wrote the following little
>>> program in IDLE
>>>
>>> # calculating the mean
>>>
>>> data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11]
>>>
>>> def mean(data):
>>> 	return sum(data)/len(data)
>>>
>>> mean(data1)
>>>
>>>
>>> There is no syntax highlighting and when I ran it F5, I got the
>>> following in the shell window.
>>>
>>>
>>>   >>> ================================ RESTART
>>> ================================
>>>>>>
>>>>>>
>>>
>>>
>>> Any ideas?
>>
>> I don't know what editor you're using or how it works, but I'm guessing
>> that pressing f5 runs what you've written as a script, right? In that
>> case the interpreter doesn't automatically print the result of
>> expressions in the same way that the interactive interpreter does; you
>> didn't tell it to print anything, so it didn't.
>>
> It looks like it's IDLE.

Actually, he does say that it's IDLE at the start.
[snip]




More information about the Python-list mailing list