Joanna Kowal
Joanna Kowal

Reputation: 161

Can PyCharm display variable value as hexadecimal number?

I'm debugging a python script in PyCharm and can't find a way to display integer values as hexadecimal numbers. Is it at all possible in this IDE?

Upvotes: 5

Views: 2535

Answers (3)

Pavel Karateev
Pavel Karateev

Reputation: 8550

This feature (for PyCharm) is implemented and is going to be included in 2019.3 release. Ticket https://youtrack.jetbrains.com/issue/PY-8118


Update 2019.3.4

enter image description here

Upvotes: 6

bgse
bgse

Reputation: 8587

As @ndclt pointed out, you can't yet, but a workaround for the time being could be using the evaluate expression functionality.

Say you are interested in the hex representation of a, you can use the built-in function hex() to achieve this:

hex(a)

Putting this in the evaluate expression dialog would give you the hex representation string.

You can bring up that action using CTRL+F8 (Windows/Linux) or ALT+F8 (Mac).

Upvotes: 2

ndclt
ndclt

Reputation: 3168

Yet, you can't. There is an open issue also concerning Pycharm if you want to follow this feature.

Upvotes: 1

Related Questions