4/11/2020 4:11:26 AM
karangreat5 Answers
New AnswerHave you tried this :) import inspect,this print(inspect.getsource(this)) edit: https://stackoverflow.com/questions/427453/how-can-i-get-the-source-code-of-a-python-function
The source code for Python's built-in functions is written in c and can only be accessed by looking at the Python's source code (hosted on Mercurial or downloadable from https://www.python.org/downloads/source/). But you can get source code of methods and defined functions: https://code.sololearn.com/cE8HJLBJXSPK/?ref=app
Daljeet Singh it is working but only for user defined functions not for inbuilt function 😞 https://code.sololearn.com/cAHsIKZvIkoC/?ref=app
PythonPip It's not working for time module https://code.sololearn.com/cRG8Yi32ChvX/?ref=app
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message