代码:

import os

#os.system('python hello1.py')

while 1:
    print("****************\n")
    print("****************\n")
    num = input("please input a num: ")
    try:
        print(num)
        if num == 'a':
            os.system('python hello1.py')
        if num == 2:
            os.system('python ')
            print(successful)
        if num == 3:
            os.system('python ')
        if num == 4:
            print("****************\n")
            print("****************\n")
            break

    except ValueError:
        print("It's not a num, Please enter again\n")

用os组件函数实现

相关文章:

  • 2022-01-04
  • 2021-12-18
  • 2021-10-22
  • 2021-06-16
  • 2021-10-07
  • 2022-01-15
猜你喜欢
  • 2021-05-18
  • 2021-09-08
  • 2022-12-23
  • 2021-12-28
  • 2021-12-23
  • 2021-12-06
  • 2021-12-05
相关资源
相似解决方案