Avatar ·

在Python代码中隐藏登录名和密码

📁 python, 问题

如何加密代码中的登录名和密码?或者通过其他方式使其他人无法获取它们,因为代码本身必须是公开且可供其他人查看的。

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

在这种情况下,使用像 问题中提到的 方法是否有意义?