py调用另一个py

 1 import os 
 2 
 3 #os.system('python hello1.py')
 4 
 5 
 6 while 1: 
 7     print("****************\n")
 8     print("****************\n")
 9     num = input("please input a num: ")
10     try:                                                                        
11         print(num)
12         if num == 'a':
13             os.system('python hello1.py')
14         if num == 2: 
15             os.system('python ')
16             print(successful)
17         if num == 3: 
18             os.system('python ')
19         if num == 4: 
20             print("****************\n")
21             print("****************\n")
22             break
23 
24     except ValueError:
25         print("It's not a num, Please enter again\n")

 

posted @ 2020-10-17 16:07  miaorn  阅读(164)  评论(0编辑  收藏  举报