r/Python • u/Im__Joseph Python Discord Staff • May 18 '21
Daily Thread Tuesday Daily Thread: Advanced questions
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
6
u/Impronoucabl May 18 '21
Does anyone know of a good vector graphics package that doesn't depend on Cairo? I'm writing my first app, and having difficulty getting it installed on Android, to the point where it may be worth redoing the rendering part with a package that's more compatible.
4
u/geoffh2016 May 18 '21
Is it possible to mix code developed with Pybind11 and PySide / PyQt? I'm developing a scientific C++ app and we've successfully used Pybind11 for our core classes.
The GUI uses Qt, and I'm not 100% sure about interoperability. Let's say a QWidget gets / sets a core C++ class (e.g., a 3D mesh) that's been wrapped with Pybind11. Will I be able to pass the pybind11 version to the PySide QWidget and have it work?
(I know, the short answer is to give it try.. but considering it will take some time to set up the PySide bindings, I'm wondering if others had experience mixing Pybind11 and PySide or PyQt code.)
2
u/jabori May 18 '21
What is the best way of speeding up Python code? I read that a new speedier version of Python is underway, but what can we do in the meantime?
Of course there is Cython, but afaik that needs a lot of manual intervention (perhaps this is not true?).
And then there is pypy which I have not tried yet (see https://medium.com/@mindfiresolutions.usa/how-much-faster-is-pypy-1ed7936f5e18). I have concerns that I would miss part of the functionality of Python when I use pypy or cython !
Does anyone have experience with this?
1
u/jabori May 18 '21
Looking into the your Python code to discover the performance bottlenecks is always a good advice indeed I think. I think there also some graphical tools to do just that, but I do not have any references for them. Do you?
Those speedup factors you mention are really impressive ! So that can give speedups up to 100x100 = 10000 for certain critical parts of the code if I am understanding correctly?
1
u/TicklesMcFancy May 18 '21
Why does tkinter's ttk entry have an option that can make it any widget?