1
print("||") + os.system('PING -n 1 {} | FIND "TTL="'.format(host))

the output is:

  ||
  reply from {}: ms etc

is it possible to make it like this?

  || reply from {}: ms etc
enzo
  • 9,861
  • 3
  • 15
  • 38
hcign
  • 43
  • 3

1 Answers1

0
  1. Change the end parameter of your print from a new-line (the default) to an empty space

  2. Flush the print so the os.system output will come after the print

  3. Don't add print to os.system since print returns None

import os

print("||", end='', flush=True)
os.system('PING -n 1 {} | FIND "TTL="'.format(host))
enzo
  • 9,861
  • 3
  • 15
  • 38