Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
generators as filters
#1
suppose you have a couple routines in separate contexts that send data objects back and forth to each other? how easy is it to insert a generator to "filter" the data (which may reduce the amount or increase the amount or just change it)? how about separate generators for each direction? how about multiple generators in stacked sequence.

i want to make a "filter" that encodes bytes/characters so that if i send chr(13) it sends chr(92)+chr(114) ('\\r') or chr(92)+chr(82) ('\\R') or chr(94)+chr(77) ('^M') on to the next routine (and many other codes encoded the proper way), sending them one byte/character at a time, or buffered if supported ... and one that does the reverse decoding.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  generators with errors Skaperen 1 1,043 Jun-16-2022, 05:41 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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