This could work:
import sys
def str_to_class(classname):
return getattr(sys.modules[__name__], classname)
More Related Contents:
- python building coder for ceasar cipher
- task: Prime numbers in function
- Fast punctuation removal with pandas
- How do I hide the console when I use os.system() or subprocess.call()?
- Slicing a list in Python without generating a copy
- Plotting dates on the x-axis with Python’s matplotlib
- Skip rows during csv import pandas
- Display fullscreen mode on Tkinter
- Python script to copy text to clipboard [duplicate]
- How to make python Requests work via socks proxy
- How to deal with Kivy installing error in Python 3.8?
- “OSError: [Errno 2] No such file or directory” while using python subprocess with command and arguments
- PermissionError: [WinError 32] The process cannot access the file because it is being used by another process
- Any reason not to use ‘+’ to concatenate two strings?
- How to use `cv2.findContours` in different OpenCV versions?
- Removing control characters from a string in python
- anaconda/conda – install a specific package version
- pandas to_csv output quoting issue
- Python pretty XML printer with lxml
- How to find the index of a value in 2d array in Python?
- Python xlwt – accessing existing cell content, auto-adjust column width
- Pandas: append dataframe to another df
- How do I wrap a string in a file in Python?
- how can i get the executable’s current directory in py2exe?
- PyAudio failed to install on Windows 10
- Matplotlib: Aligning y-ticks to the left
- Python floating point number comparison
- What is the time complexity of heapq.nlargest?
- How to install and import Python modules at runtime
- permutations of two lists in python