Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)
edited by
I'm making a Skype bot for a social affair of sidekicks, and I need to have the choice to have a reasonable login system for text-based games and taking care of information, for instance, usernames, high scores, notes, colleagues rundown, messages, etc

I was considering putting away it in a content document named after the individual's idea about Skype, in any case, I was contemplating whether there was a superior method of doing it. For example, XML records.

I'd prefer to keep away from SQL workers and dislike they're putting away passwords so encryption won't be that a very remarkable serious deal. (I'd favor nearby document stockpiling. Something effectively editable and erase capably)

I need to empower orders, for example, !note and !companions and !addfriend and !highscore, etc, yet I need a technique to spare that data.

Much appreciated in cutting edge. :)

1 Answer

0 votes
by (26.4k points)

Have you thought about pickle? It can store python object (any item) to documents so you can simply load and use them.

import pickle

# Saving

data = [1,2,3,4]

pickle.dump(data, open("d:/temp/test.pkl","wb"))

# Loading

load = pickle.load(open("d:/temp/test.pkl","rb"))

Click on this link, for more details.

Want to know more about python? Come and join: Python course

Browse Categories

...