From fb73d23c06443a11560ad5fcc4ca782229fde847 Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Tue, 23 Feb 2010 12:04:41 +0100 Subject: [PATCH] =?UTF-8?q?Qualche=20altra=20modifica.=20Mi=20sa=20che=20p?= =?UTF-8?q?er=20essere=20python=20puro=20di=20pi=C3=B9=20non=20si=20pu?= =?UTF-8?q?=C3=B2=20pretendere.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NewtonFractal.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 NewtonFractal.py diff --git a/NewtonFractal.py b/NewtonFractal.py old mode 100644 new mode 100755 index 5cbe466..2e124d0 --- a/NewtonFractal.py +++ b/NewtonFractal.py @@ -1,4 +1,4 @@ -#!/usr/bin/enb python +#!/usr/bin/env python # -*- coding: utf-8 -*- # # Sample script to generate a PNM image @@ -50,8 +50,8 @@ def Newton(size = 200): delta = 4 / float(size - 1) # Creiamo gli indici su cui iterare - x_values = xrange(0 , size) - y_values = x_values + x_range = xrange(0 , size) + y_range = x_range # Apriamo il file dove salveremo il nostro lavoro @@ -62,8 +62,8 @@ def Newton(size = 200): f.write("255\n") # Scriviamo la matrice su file - for x in x_values: - for y in y_values: + for x in x_range: + for y in y_range: value = GetNewtonConvergenceSpeed(complex(-2 + x * delta, -2 + y * delta)) f.write( str(3 * value) + " " + @@ -74,4 +74,4 @@ def Newton(size = 200): if __name__ == "__main__": - Newton (500) + Newton (1024) -- 2.1.4