I have multiple variables which want to be initialized,
trading_symbol = "TSLA" # won't change in the future
trading_period = read_config_json("trading_period") # will changed only inside config.json
count = 0 # will be changed inside the class frequently
Where trading_symbol, trading_period, and count should be placed in the Trading class is the best practice in Python?
# define as a global variable
class Trading:
# define as a class variable
def __init__:
# define as an instance variable
def run():
# running some trading logic here
if __name__ == "__main__":
# define as a global variable but won't be called by importing
trading = Trading()
trading.run()