PyQt5 / PySide2 QTableView how to find out if row is selected and which one in Python?

Question: I have a QTableView in PyQT5 / PySide2 I want to Know if a row is selected (my tableview is set to select by rows) Know which row is selected Thanks Answer: A bit hackishly though:

but that does it well:

We Launched a Pyside Docs Section 🎉

We Launched a Pyside Docs Section 🎉

Hi folks, an announcement! It’s a bit sad to see that PySide Docs are actually Qt examples. The name is cut off from the scene. We’ve started a project devoted to Pyside docs at pythonmembers.club/pyside. We intend to write self-contained snippets to help people out! Mail arj dot python at gmail dot com if you… Continue Reading We Launched a Pyside Docs Section 🎉

Get Python’s help() function stored as string just like console

Get Python’s help() function stored as string just like console

Python’s help function lets you see the help message written for you by the developer. It is particularly useful in IDLE / shell to inspect modules and explore. Here is a sample shell demo

Now if we want to store that text in a string, if we try x = help(print), we get not… Continue Reading Get Python’s help() function stored as string just like console

String Manipulation Functions: The Top 5 You Forgot To Pack

String Manipulation Functions: The Top 5 You Forgot To Pack

String manipulation functions, good ones are available by default in Python. Ignorance make people always re-invent. Python is powerful and … thoughtful. We were strict and choose only 5, the five best. Hope you enjoy it! What are string manipulation functions? String manipulation functions are helper functions used to manipulate strings. If you have let… Continue Reading String Manipulation Functions: The Top 5 You Forgot To Pack

DSL / Python / New Language: How to build a CSS pre-processor (like SASS) from scratch (DotDot)

DSL / Python / New Language: How to build a CSS pre-processor (like SASS) from scratch (DotDot)

If you are in web development, maybe you’ve heard of Sass, Less, Pug, Stylus etc. All these are pre-processors. In this tutorial we’re going to build nothing less than a functional css pre-processor from scratch with variables and functions. This type of new language is called source-to-source compiled. If you are thrilled, i hope not… Continue Reading DSL / Python / New Language: How to build a CSS pre-processor (like SASS) from scratch (DotDot)