User:Mihail Bakalov/Trimester 1/NETWORK BASED PROTOTYPING/AstralDataProject: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "<script python> import csv import turtle t = [] r = csv.DictReader(open("asas.csv")) counter=0 f = [] for row in r: if row.get("Class") == "Mira": t.append(int(float(ro...")
 
No edit summary
 
Line 1: Line 1:
<script python>
<script>


import csv
import csv

Latest revision as of 16:43, 15 January 2014

<script>

import csv import turtle t = [] r = csv.DictReader(open("asas.csv")) counter=0 f = [] for row in r:

   if row.get("Class") == "Mira":

t.append(int(float(row.get("DEC"))))

print t[0]


d = t[counter]-t[counter-1] g = t[counter] gg = t[counter-1] for value in t: if counter == 0: if g > 0 and g < gg and d > 0: turtle.fd(10) turtle.rt(t[counter]) elif g > 0 and g < gg and d < 0: turtle.fd(10) turtle.lt(t[counter]) elif g > 0 and g > gg: turtle.fd(10) turtle.lt(t[counter]) elif g < 0 and g > gg: turtle.fd(10) turtle.rt(t[counter]) else: turtle.fd(10) turtle.rt(t[counter])

#turtle.fd(10) #turtle.lt(t[counter]) else: if g > 0 and g < gg and d > 0: turtle.fd(10) turtle.lt(t[counter]) elif g > 0 and g < gg and d < 0: turtle.fd(10) turtle.rt(t[counter]) elif g > 0 and g > gg: turtle.fd(10) turtle.lt(t[counter]) elif g < 0 and g > gg: turtle.rd(10) turtle.lt(t[counter]) else: turtle.fd(10) turtle.lt(t[counter])

counter+=1


</script>