KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to import some package depending on which value the user chooses. The default is file1.py : from files import file1 If user chooses file2 , it should be : from files import file2 In PHP, I can do this using variable variables : $file_name = 'file1'; include($$file_name); $file_name = 'file2'; include($$file_name); How can I do this in Python?
Tags (comma-separated)
Save Edits
Cancel