Python Forum
how to combine mumtiple for loops in single loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to combine mumtiple for loops in single loop
#16
Since this is python 2 try to put u'' before the string to tell Python that this is Unicode, not ASCII.

for item in system_items:
    print u'{oid}.{oid_index} {snmp_type} = {value}'.format(
        oid=item.oid,
        oid_index=item.oid_index,
        snmp_type=item.snmp_type,
        value=item.value
    )
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: how to combine mumtiple for loops in single loop - by wavic - Mar-07-2018, 09:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Nested for loops - help with iterating a variable outside of the main loop dm222 4 1,745 Aug-17-2022, 10:17 PM
Last Post: deanhystad
  Print output in single file using pramika loop deepakkhw 1 2,157 Jul-11-2020, 11:57 AM
Last Post: j.crater
  Unable to combine print statements in for loop adeana 2 2,080 Jun-12-2020, 05:08 PM
Last Post: adeana
  Is it possible to avoid 2 loops inside another loop? SvetlanaofVodianova 2 2,242 Nov-27-2019, 02:30 PM
Last Post: Gribouillis
  Loop through folder of Excel Files and extract single column fioranosnake 2 4,633 Oct-28-2019, 05:19 PM
Last Post: fioranosnake
  Combine two scripts and loop BMC 2 2,122 Feb-17-2019, 02:13 PM
Last Post: BMC
  Loops - new terminal output to file for each loop jm_ice 1 2,649 Dec-21-2018, 02:42 PM
Last Post: ichabod801
  Python-for loop print into single line dragan979 4 7,166 Nov-23-2018, 01:01 AM
Last Post: wavic
  Using nested for loop with a single list mikeavison 3 3,381 Aug-12-2017, 08:13 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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