[Tutor] strange output
Luke Paireepinart
rabidpoobear at gmail.com
Wed Jul 11 23:27:19 CEST 2007
Alan Gauld wrote:
> "elis aeris" <hunter92383 at gmail.com> wrote in message
> news:674d5ce60707111328o5f542934i60a72c66b4293ab at mail.gmail.com...
>
>> def mousemove():
>> f.write("command" + " =" + " mousemove\n")
>> f.write("parameter_" + str(number_1) + "=" + " 500\n")
>> f.write("parameter_" + str(number_2) + "=" + " 500\n")
>> f.write("parameter_" + str(number_3) + "=" + " 500\n")
>> f.write("parameter_" + str(number_4) + "=" + " 500\n")
>> f.write("parameter_" + str(number_5) + "=" + " 500\n")
>> f.write("parameter_" + str(number_6) + "=" + " 500\n")
>>
>>
>> f = open("data.ini", "w")
>> mousemove()
>> f.close()
>>
>>
>>
>>
>> even though this part is skippe
>>
>> number_1 = 100
>> number_2 = 200
>> number_3 = 300
>> number_4 = 400
>> number_5 = 500
>> number_6 = 600
>>
>>
>
> Are you doing this in a file or using the >>> prompt?
> If its at the >>> prompt then it will remember the number_1 values
> from earlier. If you are saying you now have a file without the
> number_1 stuff and just the function above then that is indeed odd!
>
Also, IDLE without a subprocess will keep modules and such around, and
since those are just objects,
I suspect it keeps local variables too, until you restart IDLE.
-Luke
More information about the Tutor
mailing list