Python version:
Python 3.6
I have this class:
class Backup:
class Create:
@staticmethod
def all():
print('create all')
@staticmethod
def user(username):
print('create user: ' + username)
@staticmethod
def file(filename):
print('create file: ' + filename)
class Restore:
@staticmethod
def all():
print('restore all')
@staticmethod
def user(username):
print('restore user: ' + username)
@staticmethod
def file(filename):
print('restore file: ' + filename)
class Delete:
@staticmethod
def all():
print('delete all')
@staticmethod
def user(username):
print('delete user: ' + username)
@staticmethod
def file(filename):
print('delete file: ' + filename)
But I want to move the nested classes to their own modules and import them, but I am not sure how to do that. Here was my latest attempt based on some similar stack overflow questions. Obviously it didn't work:
from Models.Create import Create
class Backup(Create):
Does anyone know how to achieve what I am trying to do so I can still call the methods in the classes like this: Backup.Create.all()