Skip to content

Commit

Permalink
fix: use utf-8 encoding in check_output
Browse files Browse the repository at this point in the history
fix the output from byte literal to utf-8 decoded string
  • Loading branch information
cgomesu authored Oct 6, 2023
1 parent 6172dc8 commit fb58aca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo_clock_and_IP.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime
from subprocess import check_output
display = drivers.Lcd()
IP = check_output(["hostname", "-I"]).split()[0].decode('ascii')
IP = check_output(["hostname", "-I"], encoding="utf8").split()[0]
try:
print("Writing to display")
while True:
Expand Down

0 comments on commit fb58aca

Please sign in to comment.