Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬,objprint可以打印出函数的内容吗?类似于js中console.log()方法。 #71

Closed
xuxiaobo-bobo opened this issue Jul 6, 2022 · 1 comment

Comments

@xuxiaobo-bobo
Copy link

//JavaScript
function ad(a, b) {

return a + b;

}

console.log(ad.toString())

//输出
// function ad(a, b) {
//
// return a + b;
// }

//python
def ad(a,b):
return a+b
print(ad)

输出

<function ad at 0x000002511B318550>

@gaogaotiantian
Copy link
Owner

Check inspect.getsource()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants