Python Forum
i need to make a command that ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i need to make a command that ...
#2
Here is one. You can improve it with argparse to include the --help option.
import sys

BUFSIZE = 1024

def main():
    while True:
        s = sys.stdin.read(BUFSIZE)
        if not s:
            break
        sys.stdout.write(repr(s)[1:-1])
        sys.stdout.flush()

if __name__ == '__main__':
    main()
Reply


Messages In This Thread
i need to make a command that ... - by Skaperen - Nov-29-2019, 08:56 AM
RE: i need to make a command that ... - by Gribouillis - Nov-29-2019, 11:18 AM
RE: i need to make a command that ... - by Skaperen - Nov-30-2019, 05:03 AM
RE: i need to make a command that ... - by ndc85430 - Nov-30-2019, 08:20 AM
RE: i need to make a command that ... - by Skaperen - Nov-30-2019, 09:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  i want to make a cli command that ... Skaperen 9 5,308 Oct-01-2017, 06:35 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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