Avatar ·

Hiding login and password in Python code

📁 Advanced Python Topics, question

How can I encrypt the login and password in the code itself? Or in some other way make it so that other people cannot obtain them, since the code itself must be open and accessible for viewing by others.

conn = pymysql.connect(    host=""xxc.ru"",    port=3306,    user=""user"",    password=""password"",    db=""test"",    charset='utf8')

Does it make sense to use in this case, as in the question?