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
#19
Wavic, same result without brackets

for item in system_items:
    print(type(item.value))
    print(repr(item.value))
    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
    )
output

Output:
enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.221.32. OCTETSTR = ð>�Ý <type 'unicode'> u'\xf0>\x90\x1f\xddP' enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.221.80. OCTETSTR = ð>�ÝP <type 'unicode'> u'\xf0>\x90\x1f\xdd`' enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.221.96. OCTETSTR = ð>�Ý` <type 'unicode'> u'\xf0>\x90\x1f\xdd\xb0' enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.221.176. OCTETSTR = ð>�Ý° <type 'unicode'> u'\xf0>\x90\x1f\xdd\xf0' enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.221.240. OCTETSTR = ð>�Ýð <type 'unicode'> u'\xf0>\x90\x1f\xde\x00' enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.222.0. OCTETSTR = ð>�Þ <type 'unicode'> u'\xf0>\x90\x1f\xde\x10' enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.222.16. OCTETSTR = ð>�Þ <type 'unicode'> u'\xf0>\x90\x1f\xde ' enterprises.25053.1.3.2.1.1.2.2.1.1.6.240.62.144.31.222.32. OCTETSTR = ð>�Þ <type 'unicode'> u'\xf0>\x90\x1f\xde0'
Reply


Messages In This Thread
RE: how to combine mumtiple for loops in single loop - by anna - Mar-07-2018, 10:01 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,788 Aug-17-2022, 10:17 PM
Last Post: deanhystad
  Print output in single file using pramika loop deepakkhw 1 2,186 Jul-11-2020, 11:57 AM
Last Post: j.crater
  Unable to combine print statements in for loop adeana 2 2,109 Jun-12-2020, 05:08 PM
Last Post: adeana
  Is it possible to avoid 2 loops inside another loop? SvetlanaofVodianova 2 2,266 Nov-27-2019, 02:30 PM
Last Post: Gribouillis
  Loop through folder of Excel Files and extract single column fioranosnake 2 4,655 Oct-28-2019, 05:19 PM
Last Post: fioranosnake
  Combine two scripts and loop BMC 2 2,148 Feb-17-2019, 02:13 PM
Last Post: BMC
  Loops - new terminal output to file for each loop jm_ice 1 2,672 Dec-21-2018, 02:42 PM
Last Post: ichabod801
  Python-for loop print into single line dragan979 4 7,195 Nov-23-2018, 01:01 AM
Last Post: wavic
  Using nested for loop with a single list mikeavison 3 3,414 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