

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get a function name as a string in Python?
Every function has a property called __name__ attached to it. We can access this property and get the name of a function. For example:
def some_func(): return 0 print some_func.__name__
This will give us the output:
some_func
- Related Questions & Answers
- How to get a variable name as a string in Python?
- How to get a variable name as a string in PHP?
- Python How to get function name?
- How to execute a JavaScript function when I have its name as a string?
- How to pass Python function as a function argument?
- How to call a function of a module from a string with the function's name in Python?
- How to call a function of a module from a string with the function's name in Python?
- How to get current function name in PHP?
- How to invoke a JavaScript Function as a function?
- How to pass a dictionary as argument in Python function?
- How to pass a json object as a parameter to a python function?
- How to get the entire document HTML as a string in JavaScript?
- How to invoke a function as a function and method?
- How do I invoke a Java method when given the method name as a string?
- How to invoke a JavaScript Function as a method?
Advertisements