Python Forum
loop for dynamic cut string - cleaner way?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
loop for dynamic cut string - cleaner way?
#4
There are three calls to ifh.read() in this code. The first call reads the ID tag, the second call reads the length and the third call reads the data. Perhaps you need to learn about Python 3.8's walrus operator := ?
Reply


Messages In This Thread
RE: loop for dynamic cut string - cleaner way? - by Gribouillis - Nov-22-2021, 02:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating a loop with dynamic variables instead of hardcoded values FugaziRocks 3 1,510 Jul-27-2022, 08:50 PM
Last Post: rob101
  Loop through a list of string oldtrafford 4 1,487 Mar-24-2022, 05:30 PM
Last Post: deanhystad
  Loop through a list of string oldtrafford 3 1,724 Feb-15-2022, 04:42 PM
Last Post: snippsat
  I am trying to reverse a string using loop codinglearner 4 2,188 Sep-28-2021, 10:46 PM
Last Post: Pedroski55
  Create Dynamic For Loop quest 3 4,429 Apr-26-2021, 02:03 PM
Last Post: ibreeden
  cursor.execute: How to insert dynamic number in a string? stoeberhai 2 3,534 Mar-18-2021, 12:55 PM
Last Post: stoeberhai
  Convert string to JSON using a for loop PG_Breizh 3 2,989 Jan-08-2021, 06:10 PM
Last Post: PG_Breizh
  String slicing and loop iteration divyansh 9 4,774 Jun-07-2020, 10:29 PM
Last Post: divyansh
  Cleaner way to rewrite fakka 5 3,095 Dec-05-2019, 04:53 AM
Last Post: stullis
  Putting an array for each string that is printed to a loop ClaudioSimonetti 1 2,354 Feb-05-2019, 12:52 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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