fork download
  1. import time
  2. from openccc import OpenCC
  3.  
  4. class A(object):
  5. def __init__(self, i):
  6. self.i = i
  7.  
  8. def get(self):
  9. return self.i
  10.  
  11. class a(object):
  12. def func1(self, i):
  13. return i
  14.  
  15. def test(self, total):
  16. startime = time.time()
  17. result = []
  18. for i in range(total):
  19. result.append(A(i))
  20.  
  21. self.aa = OpenCC('s2twp')
  22.  
  23. for idx, r in enumerate(result,start=1):
  24. print (r.get())
  25. print('{}/{}'.format(idx, total), end='\r')
  26. print ('')
  27. print ('time=', time.time()-startime)
  28.  
  29. if __name__ == '__main__':
  30. o = a()
  31. o.test(700)
Runtime error #stdin #stdout #stderr 0.14s 23620KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 2, in <module>
    from openccc import OpenCC
ModuleNotFoundError: No module named 'openccc'