I'm a total newbie in Python. I hope someone could be so kind and help me out here. I'm trying to transfer some MATLAB source codes to Python and run into a problem.
In MATLAB there is a command "nargout" which returns the number of output arguments specified in the call to the currently executing function.
I would like to use similar method for Python in order to decrease the processing time.
The user should be able to choose which output arguments of function he needs and the unchosen one should be ignored and should not be calculated at all. In order to be able to do that, the number of output arguments which user has chosen, need to be determined first. And I absolutely have no idea how to do this.
Example of my code
if the user calls the function like this, all parameters should be calculated and shown.
Expand|Select|Wrap|Line Numbers
- q,r,s = ft(a,b)
But if user calls only "q, r". Then "s" should be ignored and not calculated.
Expand|Select|Wrap|Line Numbers
- q,r = ft(a,b)
Thank you very much in advance for every answer!
Regards,
Anna