Skip to content

Instantly share code, notes, and snippets.

@Aekschen
Aekschen / zip.py
Created April 15, 2019 19:48
Python zip
# Why Python Is Great: # Function argument unpacking def myfunc(x, y, z): print(x, y, z) tuple_vec = (1, 0, 1) dict_vec = {'x': 1, 'y': 0, 'z': 1} >>> myfunc(*tuple_vec) 1, 0, 1 >>> myfunc(**dict_vec) 1, 0, 1
import datetime
import time
start = datetime.datetime.now()
print("Start Time: " + str(datetime.datetime.now()))
time.sleep(2)
end = datetime.datetime.now()
print("End Time: " + str(datetime.datetime.now()))
print("Time between is " + str((end - start)).split(".")[0] )
@Aekschen
Aekschen / readTextFile.py
Created October 10, 2018 21:54
read text file
def read_geojson_array():
with open('/tmp/unicode.txt') as f:
variable=f.read()
print(variable)