添加聚烯烃定时任务脚本
This commit is contained in:
		
							parent
							
								
									0893fbde4d
								
							
						
					
					
						commit
						c8ff211de4
					
				
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										22
									
								
								聚烯烃预测定时任务,请勿关闭.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								聚烯烃预测定时任务,请勿关闭.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					# 定时执行cmd命令
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import time
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					while True:
 | 
				
			||||||
 | 
					    try:
 | 
				
			||||||
 | 
					        print(time.strftime('%H:%M'))
 | 
				
			||||||
 | 
					        # 判断是不是工作日且 是17:00 7:00  才执行
 | 
				
			||||||
 | 
					        if time.strftime('%A') not in ['Saturday', 'Sunday'] and time.strftime('%H:%M') in ['16:10']:
 | 
				
			||||||
 | 
					            # 要执行的命令
 | 
				
			||||||
 | 
					            command = r"d:\yuanyouyuce\envs\predict\python main_yuanyou.py"  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # 调用系统命令
 | 
				
			||||||
 | 
					            os.system(command)
 | 
				
			||||||
 | 
					        time.sleep(60)
 | 
				
			||||||
 | 
					    except:
 | 
				
			||||||
 | 
					        time.sleep(3600)
 | 
				
			||||||
 | 
					        # 要执行的命令
 | 
				
			||||||
 | 
					        command = r"d:\yuanyouyuce\envs\predict\python main_juxiting.py"  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # 调用系统命令
 | 
				
			||||||
 | 
					        os.system(command)
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user