第一次执行时,代码运行平稳,但是第二次执行时,代码挂在了导入paramiko行上
我已经分别运行代码,没有问题
import datetime
t=datetime.datetime.now()
print(t)
print('start file')
import sys
import os
import xml.etree.ElementTree as ET
print('other modules imported')
t2=datetime.datetime.now()
print('time taken',t2-t)
import cx_Oracle
print('orcale imported')
t3=datetime.datetime.now()
print('time taken',t3-t2)
import paramiko
print('paramike imported')
t4=datetime.datetime.now()
print('time taken',t4-t3)
con = cx_Oracle.connect('username/password@IP:port/name')
cur = con.cursor()
cur.close()
con.close()
每次重复执行时导入paramiko所需的时间都更长。我在Centos上只有这个问题。在Windows上似乎还不错。还有其他人遇到这个问题吗?