N
N
nexus02018-07-07 20:37:07
linux
nexus0, 2018-07-07 20:37:07

What is the "%" character in stdout?

Sometimes the character "%" appears in stdout.
For example, there is such a python script

#!/usr/bin/python
import socket
sock = socket.socket()
sock.bind(("127.0.0.1", 8081))
sock.listen(5)
conn, addr = sock.accept()
conn.send(b"Hi!")
conn.close()

I connect with netcat to the server, I get in stdout
~/python/http> nc 127.0.0.1 8081
Hi!%

What does the "%" symbol mean?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nexus0, 2018-07-07
@nexus0

This shell says that there was no \n (line break) at the end, so "I put it myself so as not to break the appearance of the console"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question