I have the following code:
from functools import partial
def create_droplet(args):
print(args)
def droplets():
print("test")
commands = {
'create_droplet': partial(create_droplet),
}
command_in = input()
command = command_in.split(" ")[:1][0]
if command in commands:
args = command_in.split(" ")[1:]
commands[command](args)
What I want to do is allow droplets()
to be called by adding 'droplets': droplet
to commands
, but since it doesn't take any arguments I get TypeError: droplets() takes 0 positional arguments but 1 was given
.