Traceback (most recent call last):
File "H:/My Documents/PyCharm/tst/tst38.py", line 14, in <module>
y1 = numpy.sqrt(x1)
AttributeError: 'int' object has no attribute 'sqrt'
# -*- coding: utf-8 -*-
import math
import sys
if __name__ == '__main__':
x1 = 1000000000000000000000000000000000000000000000000000000000000000000000
x2 = float(x1)
print(sys.getsizeof(x1))
print(sys.getsizeof(x2))
y1 = math.sqrt(x1)
y2 = math.sqrt(x2)
print(y1-y2)
def resource_path(relative):
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, relative)
else:
return os.path.join(os.path.abspath("."), relative)
# ....
pixmap = QPixmap(resource_path("bg.jpg"))