Skip to content

Commit

Permalink
Update code to use print formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
pvcraven committed Nov 10, 2021
1 parent e586caf commit 65265ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manchester_decoding_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def data_callback(channel):
time_interval = cur_time - data_callback.last_call

dl = "L->H" if data_line else "H->L"
print(" Change: {} Interval: {:.3f}".format(dl, time_interval))
print(f" Change: {dl} Interval: {time_interval:.3f}")

data_callback.last_call = cur_time

Expand Down
2 changes: 1 addition & 1 deletion manchester_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
time.sleep(CLOCK_SPEED)

# print(bit, end="")
print(" - {:3} - {:}".format(my_byte, chr(my_byte)))
print(f" - {my_byte:3} - {chr(my_byte)}")

time.sleep(CLOCK_SPEED * 4)
GPIO.cleanup()
Expand Down

0 comments on commit 65265ee

Please sign in to comment.