How To Make A Global Log In System

In this tutorial, you will learn how to make a global login system. What this means is that the player's data will save even if they end the code.

So the first thing that we will need to do is have the player be able to make an account. So let's make an input for the username.

username = input()

Now that we have a way to get a username now we need to be able to give it a value. So let's make an input for the value.

value = input()

Now let's create the key for the login to connect it to the value.

db["username"] = "value"

You need to make sure that the key and value is the same to which variable you would like to save. Now that we have a way to create an account let's make a way to log in.

LogIn = input()
value = db["LogIn"]

What this does is get the value of a username. The login will need to be what the created username name is.

Now you can make a game that saves info!

You are viewing a single comment. View All