A
A
arsfilinov2021-04-01 10:08:10
Python
arsfilinov, 2021-04-01 10:08:10

I have a small problem with the pillow library, how to display exactly a numeric variable?

The problem is that: I use the Pillow library to display text on a photo, but there is such a problem that when I display the balance variable, which is numeric, I get an error:

Traceback (most recent call last):
  File "C:\Users\Lenovo\pil.py", line 12, in <module>
    idraw.text((110, 20), balance, font = headline)
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python39\lib\site-packages\PIL\ImageDraw.py", line 289, in text
    if self._multiline_check(text):
  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python39\lib\site-packages\PIL\ImageDraw.py", line 264, in _multiline_check
    return split_character in text
TypeError: argument of type 'int' is not iterable


help me please!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Dugin, 2021-04-01
@adugin

Convert variable to string: str(x)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question