Python Forum
expressing an 8-bit ASCII code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
expressing an 8-bit ASCII code
#1
every possible unambiguous way people might want to express one of the 256 possible byte codes, where the first 128 are ASCII codes, i want to be able to support. probably the most well known example is \n which is the value 10, ASCII newline. i will be reviewing past code i have written to convert a stream of the expression to a stream of 8-bit bytes. it already supports raw printable characters except for \ and ^, 3 digit octal escape sequences for all 256 possible values, \0 not followed by a digit, common single character backslash sequences \a (7), \b (8), \t (9), \n (10), \v (11), \f (12), \r (13), 59 common single character carat sequences, 26 upper case letters, 26 lower case letters, and 7 special characters, and 4 special sequences to produce \ and ^.

are there any others that would be suggested?

my intent is to make this into its own module.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
I miss EOT. If you're in a Terminal, you can use CTRL+D, which interpreted and fires a EOT, which closes the Terminal.
Another example is CTRL+L, which clears the screen in a Terminal. It's 0x0C.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
EOT is handled by the pty emulation. the terminal program just sends byte value 4 to the pty emulation. it is that emulation that converts it to end-of-file. the shell gets the EOF. Today's shells require several EOF events. Classical shells will exit upon just one such event. that exit by the shell sends SIGCHLD to the terminal. or the terminal gets EOF from the side of the PTY it's reading to get shell session output. then the terminal window closes. same action. same effect. now days just type in the shell command "exit" or hold Ctrl+D to let it repeat.

on IBM mainframes, in VM/CP, i found a bug where any "ASCII" terminal doing EOT followed rapidly by BREAK would cause the entire system to freeze requiring a reboot (IPL). the terminal did not even need to be logged in so anyone could dial up the mainframe if they had ASCII dial up and freeze the whole system. once i got the source code, i wrote a patch to fix the bug and sent it to IBM. they accepted it. the new effect took that particular terminal offline and gave the main operator a message of what happened.
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
  expressing data in python Skaperen 7 3,860 Jan-07-2020, 02:59 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