[PyQt] pyqtdeploy application on windows with math module
1004483092
1004483092 at qq.com
Tue Mar 17 03:26:00 GMT 2020
Hello Phil,
I tried many times with diffirent ways, when I enabled the math module in standard library, the application report no module named math.
when I add math module as extension module , the compiler kept reporting mathmodule.obj error LNK2019 , please tell me how to import math module , thank you!
------------------ Original ------------------
From: "Phil Thompson"<phil at riverbankcomputing.com>;
Date: Mon, Mar 16, 2020 08:11 PM
To: "1004483092"<1004483092 at qq.com>;
Cc: "pyqt"<pyqt at riverbankcomputing.com>;
Subject: Re: [PyQt] pyqtdeploy application on windows with math module
On 16/03/2020 10:41, 1004483092 wrote:
> Hello Phil,
> The math module build-in python use c modules , according to
> Python-3.7.2\setup.py , the math module information as below:
> shared_math = 'Modules/_math.o'
> # complex math library functions
> exts.append( Extension('cmath', ['cmathmodule.c'],
> extra_objects=[shared_math],
> depends=['_math.h', shared_math],
> libraries=['m']) )
> # math library functions, e.g. sin()
> exts.append( Extension('math', ['mathmodule.c'],
> extra_objects=[shared_math],
> depends=['_math.h', shared_math],
> libraries=['m']) )
>
>
> Can you tell me how to import the math module on windows via
> pyqtdeploy? thank you!
Enable the module in the pyqtdeploy GUI.
Phil
> ------------------ Original ------------------
> From: "Phil Thompson"<phil at riverbankcomputing.com>;
> Date: Mon, Mar 16, 2020 03:55 PM
> To: "1004483092"<1004483092 at qq.com>;
> Cc: "pyqt"<pyqt at riverbankcomputing.com>;
> Subject: Re: [PyQt] pyqtdeploy application on windows with math
> module
>
>
>
> I have no idea what that DLL is. pyqtdeploy supports the standard
> Python
> math module. If you do not have lots of experience building and
> debugging C++ code on Windows then please use something else.
>
> Phil
>
> On 16/03/2020 03:37, 1004483092 wrote:
> > Hello Phil,I build the demo on windows10 with VS2017 success
> according
> > to the document , but when my python script include math module ,
> the
> > application can't import math module.The math module is
> > api-ms-win-crt-math-l1-1-0.dll on windows , can you tell me how to
> > import math module via pyqtdeploy?My scripyt as below:from
> > PyQt5.QtCore import *
> > from PyQt5.QtGui import *
> > from PyQt5.QtWidgets import *
> > import sys
> > import mathclass Window(QWidget):
> > def __init__(self):
> > super().__init__()
> > self.setupUI()
> >
> > def setupUI(self):
> >
> self.lb=QLabel(self)
> >
> self.lb.setText('Label')
> >
> self.lb.move(30,10)
> >
> > self.btn =
> QPushButton('test',self)
> >
> self.btn.move(30,30)
> >
> > self.cb =
> QComboBox(self)
> >
> self.cb.move(30,70)
> >
> self.cb.resize(200,30)
> > self.resize(30,80)
> >
> >
> self.btn.clicked.connect(self.test_func)
> >
> >
> self.setWindowTitle('test')
> >
> self.setGeometry(400, 400, 300, 300) def
> test_func(self):
> > test1 =
> math.cos(30) test2 =
> math.asinh(60) test3 =
> > math.exp(40.1) test4 =
> math.expm1(5.23) test5 =
> > math.factorial(40)
> test6 = math.isfinite(3.24)
> > self.cb.addItems([f'{test1}', f'{test2}', f'{test3}', f'{test4}',
> > f'{test5}', f'{test6}'])if __name__=='__main__':
> > app = QApplication(sys.argv)
> > window=Window()
> > window.show()
> > sys.exit(app.exec_())
> > _______________________________________________
> > PyQt mailing list PyQt at riverbankcomputing.com
> > https://www.riverbankcomputing.com/mailman/listinfo/pyqt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200317/68f2ad0f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 30F9D70F at 9E22A924.4843705E.jpg
Type: image/jpeg
Size: 15729 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200317/68f2ad0f/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2FF8D814 at 1A023958.4843705E.jpg
Type: image/jpeg
Size: 27080 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200317/68f2ad0f/attachment-0003.jpg>
More information about the PyQt
mailing list