def changeNetwork(network):
    with open(filename, '+r', encoding='utf-8') as f:
        t = f.read()
        t = t.replace('const targetNetwork = NETWORKS.ropsten;', 'const targetNetwork = NETWORKS.{};'.format(network))
        f.seek(0, 0)
        f.write(t)
        f.truncate()
    print('切换网络到: {}'.format(network))
def changeNetwork(network):
    with open(filename, '+r', encoding='utf-8') as f:
        t = f.read()
        t = t.replace('const targetNetwork = NETWORKS.ropsten;', 'const targetNetwork = NETWORKS.{};'.format(network))
        f.seek(0, 0)
        f.write(t)
        f.truncate()
    print('切换网络到: {}'.format(network))