How can i convert a string in a python method? -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 10 उत्तर

    मुझे एक स्ट्रिंग मिली, के लिए उदाहरण "सहेजें" और मेरे पास पैरामीटर के साथ एक विधि बचा है I मैं कैसे तार को सहेजने के लिए कॉल में सहेज सकता हूं () मैंने eval और exec के साथ प्रयास किया।

    संपादित करें: यहां हल - & gt;

      def some_method (स्वयं): save_method = getattr (स्वयं, 'सहेजें') save_method ( ) # सेव ()    

Comments

Popular posts from this blog

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

sql - PostgreSQL automatically update row at specific date -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -