import config
import sys
import importlib
def menu():
try:
print(colors.BOLD + colors.CYAN + "Welcome to Houdini\n" + colors.RESET)
while True:
display_menu()
choice = get_user_choice()
importlib.reload(config)
print(KERNEL_VERSION)
if choice in menu_options:
menu_options[choice]()
else:
print("Invalid choice. Please try again.")
#๐ importlib.reload() does not work
17 messages ยท Page 1 of 1 (latest)
@quick rapids
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
when I change config.py, and then do importlib.reload(config), it does not change the KERNEL_VERSION
KERNEL_VERSION = "5.18.5"
this is config.py
If you're doing something like this:
KERNEL_VERSION = config.KERNEL_VERSION
Updating the module will not reassign the variable in this module.
what
You shouldn't be reloading the module anyway. Make a function that fetches the version, and call that when you need to know the version number.
but i want to able to change the KERNEL_VERSION value and using that without terminating my program
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.