I’m trying to mimic the matlab load and save functions. I’m following this thread: Shelve Code gives KeyError It is smart. However, if I write that code in a separate module, and try to import that module and invoke that function, then it can’t access the global variables. Specifically, I write a happy.py and have the functions inside: and when
Tag: shelve
Print all variables in a class? – Python
I’m making a program that can access data stored inside a class. So for example I have this class: So using this I can call out a single variable like: But if I wanted to print all variables, I’m a little lost. If I run: I get: But I want to be able to print the actual data of those.