Port from Python 2 to 3, Python is dead, long live Python
Signed-off-by: Abdulkadir Furkan Şanlı <me@abdulocra.cy>
This commit is contained in:
		
							
								
								
									
										42
									
								
								naut.py
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								naut.py
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
# !/usr/bin/python
 | 
			
		||||
 | 
			
		||||
from __future__ import division
 | 
			
		||||
 | 
			
		||||
from math import radians, cos, sin, asin, sqrt
 | 
			
		||||
import numpy as np
 | 
			
		||||
import subprocess
 | 
			
		||||
@@ -62,8 +62,8 @@ def create_random_point(x0, y0, distance):
 | 
			
		||||
    x = w * np.cos(t)
 | 
			
		||||
    x1 = x / np.cos(y0)
 | 
			
		||||
    y = w * np.sin(t)
 | 
			
		||||
    print "u="+str(u)
 | 
			
		||||
    print "v="+str(v)
 | 
			
		||||
    print("u="+str(u))
 | 
			
		||||
    print("v="+str(v))
 | 
			
		||||
    return (x0+x1, y0+y)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -103,9 +103,9 @@ for i in range(1, 2):
 | 
			
		||||
    origplot = (latitude1, longitude1)
 | 
			
		||||
    dist = haversine(origplot[0], origplot[1], newplot[0], newplot[1])
 | 
			
		||||
    dist = str(format(dist, '.2f'))
 | 
			
		||||
    print "Distance between points is ", dist
 | 
			
		||||
    print "destination: "+dest_lat+" "+dest_long
 | 
			
		||||
    print "future_time: "+future_time
 | 
			
		||||
    print("Distance between points is ", dist)
 | 
			
		||||
    print("destination: "+dest_lat+" "+dest_long)
 | 
			
		||||
    print("future_time: "+future_time)
 | 
			
		||||
    logfile.write(dtime+" homebase_lat="+orig_lat+" homebase_long="+orig_long+" dest_lat=" +
 | 
			
		||||
                  dest_lat+" dest_long="+dest_long+" future_time="+future_time+" dist="+dist)
 | 
			
		||||
 | 
			
		||||
@@ -119,21 +119,21 @@ for i in range(1, 2):
 | 
			
		||||
    rabbit_msg2 = 'white rabbit...'
 | 
			
		||||
 | 
			
		||||
    logfile.write("\n")
 | 
			
		||||
    print init1_msg
 | 
			
		||||
    print(init1_msg)
 | 
			
		||||
    time.sleep(5)
 | 
			
		||||
    print msg_breaker
 | 
			
		||||
    print init_msg
 | 
			
		||||
    print(msg_breaker)
 | 
			
		||||
    print(init_msg)
 | 
			
		||||
    time.sleep(5)
 | 
			
		||||
    print msg_breaker
 | 
			
		||||
    print rabbit_msg1
 | 
			
		||||
    print msg_breaker
 | 
			
		||||
    print msg_space2
 | 
			
		||||
    print rabbit_msg2
 | 
			
		||||
    print(msg_breaker)
 | 
			
		||||
    print(rabbit_msg1)
 | 
			
		||||
    print(msg_breaker)
 | 
			
		||||
    print(msg_space2)
 | 
			
		||||
    print(rabbit_msg2)
 | 
			
		||||
    time.sleep(5)
 | 
			
		||||
    print msg_breaker
 | 
			
		||||
    print " "+future_time
 | 
			
		||||
    print msg_breaker
 | 
			
		||||
    print " "+dest_lat
 | 
			
		||||
    print msg_space
 | 
			
		||||
    print dest_long
 | 
			
		||||
    print "https://www.google.com/maps/search/?api=1&query="+dest_lat+","+dest_long+"  Time: "+future_time
 | 
			
		||||
    print(msg_breaker)
 | 
			
		||||
    print(" "+future_time)
 | 
			
		||||
    print(msg_breaker)
 | 
			
		||||
    print(" "+dest_lat)
 | 
			
		||||
    print(msg_space)
 | 
			
		||||
    print(dest_long)
 | 
			
		||||
    print("https://www.google.com/maps/search/?api=1&query="+dest_lat+","+dest_long+"  Time: "+future_time)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user