# How to access qtcore constants in Python?

**URL:** <https://discourse.slicer.org/t/how-to-access-qtcore-constants-in-python/13137>\
**Category:** Development\
**Created:** [August 24, 2020, 6:49am UTC](https://discourse.slicer.org/t/how-to-access-qtcore-constants-in-python/13137 "2020-08-24T06:49:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 24, 2020, 2:39pm UTC](https://discourse.slicer.org/t/how-to-access-qtcore-constants-in-python/13137/2 "2020-08-24T14:39:46Z")

</div>

Slicer uses **PythonQt** library for Python wrapping of Qt. **PyQt** is not free to use (it has GPL/commercial license), so we have never even considered using it. **Python for Qt** is very popular, as it is provided by the Qt company, but PythonQt has many advantages - most importantly that it is intended for applications that embed Python.

Anyway, Slicer imports all Qt packages in `qt` namespace. For example, `QFile` class in `qtcore` can be accessed as `qt.QFile()`

---

_[View the full topic](https://discourse.slicer.org/t/how-to-access-qtcore-constants-in-python/13137)._
