import subprocess
import time

def main():
    try:
        subprocess.run(['python', 'test-data.py'], check=True)
        print("Finished joern chuli")
        time.sleep(1)  # 等待一段时间
        
        subprocess.run(['python', 'make_token.py'], check=True)
        print("Finished make_token")
        time.sleep(1)  # 等待一段时间
        
        subprocess.run(['python', 'train_model.py'], check=True)
        print("Finished train_word2vec")
        time.sleep(1)

        subprocess.run(['python', 'predata.py'], check=True)
        print("Finished data yi wancheng")
    except subprocess.CalledProcessError as e:
        print(f"Error occurred while running script: {e}")

if __name__ == "__main__":
    main()
