thon.2.5.3-rc1.source-code.snippet.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jython Show documentation
Show all versions of jython Show documentation
Jython is an implementation of the high-level, dynamic, object-oriented
language Python written in 100% Pure Java, and seamlessly integrated with
the Java platform. It thus allows you to run Python on any Java platform.
#Snippet
from java.sql import Date
from java.util import Calendar
from time import time
from datetime import date
def convert():
date_list = []
for _ in range(9775):
d = date(2012, 1, 1)
date_list.append(d)
start = time()
for item in date_list:
item.__tojava__(Calendar)
print("Time spent: %s" % (time() - start))# Snippet
if __name__ == '__main__':
convert()