Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Concatenation ??
#1
I have a string that a user enters from input()....I would like to concatenate it with '\r' (0x0D) <CR> character so that it goes out on the uart bus as such.....

c = c + '\r'

If I print© before and after I get the same thing. How do I do this such that I don't get two different characters \, r on the UART port?

I have tried c =c + '\\r' but this does NOT yield the <CR> 0x06 on the UART.....

thanks
Reply
#2
What makes you think it isn't there? Just because you cannot see it?
a = 'Jello' + '\r'
print(a, len(a), a.__repr__())
Output:
Jello 6 'Jello\r'
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries i sawtooth500 3 383 Mar-22-2024, 03:08 AM
Last Post: deanhystad
  String concatenation in SQL update statement hammer 3 1,454 Feb-24-2022, 08:00 PM
Last Post: hammer
  f string concatenation problem growSeb 3 2,212 Jun-28-2021, 05:00 AM
Last Post: buran
  Combining two strings together (not concatenation) DreamingInsanity 6 3,056 Mar-29-2019, 04:32 PM
Last Post: DreamingInsanity
  Regarding concatenation of a list to a string Kedar 2 22,742 Aug-19-2018, 12:57 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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