Python Forum
Python QGIS tool that replaces layout text labels with attributes from an input table
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python QGIS tool that replaces layout text labels with attributes from an input table
#2
Just a guess, but I would expect that QgsProject.instance().layoutManager().layouts()[0].items() would return some kind of iterable of 2-element tuples (e.g. like dict.items()) in this case l would not be an instance of QgsLayoutItemLabel.
As a side note PEP8 recommendation:
Quote:Names to Avoid

Never use the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), or 'I' (uppercase letter eye) as single character variable names.

In some fonts, these characters are indistinguishable from the numerals one and zero. When tempted to use 'l', use 'L' instead.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Python QGIS tool that replaces layout text labels with attributes from an input table - by buran - Aug-13-2019, 06:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QGIS 3.34 Python Error paskiller 2 690 Nov-13-2023, 06:20 PM
Last Post: buran
Sad How to split a String from Text Input into 40 char chunks? lastyle 7 1,158 Aug-01-2023, 09:36 AM
Last Post: Pedroski55
  Color a table cell based on specific text Creepy 11 2,014 Jul-27-2023, 02:48 PM
Last Post: deanhystad
  Use module docx to get text from a file with a table Pedroski55 8 6,201 Aug-30-2022, 10:52 PM
Last Post: Pedroski55
  Is there software/tool for coding Python? dee 11 2,870 Jun-14-2022, 02:32 PM
Last Post: dee
  [SOLVED] [ElementTree] Grab text in attributes? Winfried 3 1,640 May-27-2022, 04:59 PM
Last Post: Winfried
  Help adding prompt text in a Layout using Rich TUI Extra 2 1,664 May-23-2022, 07:15 PM
Last Post: Extra
  How to perform DESC table sort on dates stored as TEXT type. hammer 7 2,235 Mar-15-2022, 01:10 PM
Last Post: hammer
  labels.append(self.classes.index(member.find('name').text)) hobbyist 1 1,933 Dec-15-2021, 01:53 PM
Last Post: deanhystad
  python tool to collect the time measurement of entire code maiya 3 2,324 Feb-12-2021, 05:39 PM
Last Post: BashBedlam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020