I want to get the Number of required Arguments and non. I would be really happy if someone could help me, I am kinda stuck here.
I have tried following, I don't know if that is the right way to go for it.
from inspect import signature
def Test(X, Y = 4):
print(X,Y)
R = str(signature(Test))
cu = ""
for i in R:
if i.isalpha():
cu = "".join([cu,i])
print(len(cu))
#Output: 2 (I would like to have something like req_Arg = 1, non_req_Arg = 1)
I am using py 3.0
Thank you for suggestions in advance.