# not so good if 'owner' in roledict: owner = roledict['owner'] else: owner = admin # just slightly better, still not good try: owner = roledict['owner'] except KeyError: owner = admin # better owner = roledict.get('owner', admin)
In order to spawn new processes like you would do in a shell, use the subprocess module of the Python standard library.
It should be used instead of the os.system
module.
SOLID design princibles: https://www.youtube.com/watch?v=pTB30aXS77U