Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def update(new_config):
    with open(path_to_config, "r") as f:
        try:
            config = json.loads(f.read())
        except ValueError:
            config = {}

    with open(path_to_config, "w+") as f:
        for key, value in new_config.items():
            try:
                new_config[key] = int(value)
            except (ValueError, TypeError):
                try:
                    new_config[key] = float(value)
                except (ValueError, TypeError):
                    new_config[key] = value

        config.update(new_config)
        f.write(json.dumps(config))
        


src/b/i/bitcoin-arbitrage-ui-HEAD/app.py   bitcoin-arbitrage-ui(Download)
 
    new_config["observers"] = observers
    config.update(new_config)
 
    flash("Updated bot settings.")
        markets[market].append((currency1, currency2))
 
    config.update({"markets": markets})
    flash("Updated markets being watched.")