Python Forum
print is showing non printable characters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print is showing non printable characters
#3
Also new parameter in run() is capture_output=True.
import subprocess

output = subprocess.run(['ping', 'google.com'], text=True, capture_output=True)
print(output.stdout)
Output:
Pinging google.com [172.217.21.174] with 32 bytes of data: Reply from 172.217.21.174: bytes=32 time=39ms TTL=54 Reply from 172.217.21.174: bytes=32 time=37ms TTL=54 Reply from 172.217.21.174: bytes=32 time=36ms TTL=54 Reply from 172.217.21.174: bytes=32 time=35ms TTL=54 Ping statistics for 172.217.21.174: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 35ms, Maximum = 39ms, Average = 36ms
Reply


Messages In This Thread
RE: print is showing non printable characters - by snippsat - May-04-2019, 10:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  email Library: properly send message as quoted-printable malonn 3 1,387 Nov-14-2022, 09:31 PM
Last Post: malonn
  is this Unicode printable? Skaperen 2 1,474 Sep-23-2021, 01:25 AM
Last Post: Skaperen
  Print characters in a single line rather than one at a time hhydration 1 2,062 Oct-10-2020, 10:00 PM
Last Post: bowlofred
  get two characters, count and print from a .txt file Pleiades 9 3,467 Oct-05-2020, 09:22 AM
Last Post: perfringo
  Remove escape characters / Unicode characters from string DreamingInsanity 5 13,956 May-15-2020, 01:37 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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