main.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:TwitterStockMonitor 作者: semaaJ 项目源码 文件源码
def initial_start():
    print("Welcome to the Twitter Stock Monitor!")
    twitter_handles = input("Enter the Twitter handles you want this bot to follow, separated by spaces: \n").split()

    with open('./Files/config.json') as json_f:
        json_data = json.load(json_f)

    json_data["TwitterAuth"]["Handles"] = twitter_handles
    json_data["InitialStart"] = False

    with open('./Files/config.json', 'w') as json_f:
        json.dump(json_data, json_f, sort_keys=True, indent=4, ensure_ascii=False)

    print("Creating files needed..")

    for handle in twitter_handles:
        with open(f'./Files/LatestTweets/{handle}.txt', "w") as f:
            continue

    print(f'Files created! This bot will now begin to monitor: {twitter_handles}\n\n\n')

    return twitter_handles
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号