list = ["/x01", "/x30", "/x30", "/x53", "/x46", "/x46", "/x46", "/x30", "/x30", "/x30", "/x31", "/x46", "/x46", "/x0D"]
for x in list:
x.replace("[","").replace("]","").replace('"','').replace(" ","").replace(",","").replace("[","")
This hasn't been working. Could you explain what I might be doing wrong, and tell me if there is a more effective way of getting the output: "/x01/x30/x30/x53/x46/x46/x46/x30/x30/x30/x31/x46/x46/x0D"
"/x01", not"\x01"? (And, if it's the latter, do you have the four-character string with a backslash, or a single control-A?)"\x01"is not a four-character string, it's a one-character control-A. The representation of that single-character string is the six characters"\x01", but you can verify that the actual string is only one character by, e.g., typinglen("\x01")in the interactive interpreter. Also,print("\x01")will print an invisible character, not four characters.''.join(list), So, you're going to get a 14-character string with an invisible character, then00SFFF0001FF, then a carriage return, not the 56-character string you wanted.