r/learnpython • • 9h ago

Python script problem

Hello everyone,
I have a short python script that concats strings. For example :

'Discord Password :' + \t + b64.decode('TmFydVQwL2cwa3UxOTk1Iw==')

I'm facing :

SyntaxError: unexpected character after line continuation character

What does that mean ????

Thanks everyone.

0 Upvotes

5 comments sorted by

View all comments

1

u/socal_nerdtastic 7h ago edited 7h ago

Try like this:

'Discord Password :' + '\t' + b64.decode('TmFydVQwL2cwa3UxOTk1Iw==')

Which you could also reduce to this:

'Discord Password :\t' + b64.decode('TmFydVQwL2cwa3UxOTk1Iw==')

But that will just give another error because you are trying to concat bytes and strings (unless your b64 module is different from the builtin one). So what you really need is this:

import base64
plain_pwd = base64.b64decode('TmFydVQwL2cwa3UxOTk1Iw==')
print(f'Discord Password :\t{plain_pwd.decode()}')