# -*- coding: cp936 -*-
import time,os,sys,re
from sqlalchemy import *
def yn():
print("\n jk49")
yn=input("安任意键继续......")
def q_99():
print("********** 乘 法 表 **************")
num=int(input("请输入一个整数:"))
time_start=time.time()
for i in range(1,num+1):
for n in range(1,i+1):
print(n,'*',i,"=",n*i," ",end="")
print (" ")
time_end=time.time()
print("乘法",num,"*",num," 共用时间:",time_end-time_start,'秒')
yn()
def ch_cj():
print(" -------------------------------------------------------")
print("| 自动检测成绩等级: |")
print(" 1.优:90以上 2.良:70~90 3.合格:60~70 4.差:60以下 ")
num2=int(input("请输入一个成绩:"))
if num2 >=0 and num2<60:print("你的成绩是:差")
if num2>=60 and num2<70:print("你的成绩是:合格")
if num2>=70 and num2<90:print("你的成绩是:良好")
if num2>=90:print("你的成绩是:优")
if num2 <0 or num2>100:
print("你输入的成绩不在【0-100】范围内,请重新输入!")
a=[]
while True:
try:
i=int(input("please input:"))
a.append(i)
except:
break
print('最小数字:',min(a[:])," ","最大数字:",max(a[:]))
print(a)
yn()
def ch_sys():
print("\n\n-------------------------------------------")
print("常见的系统命令:")
print("1.远程桌面 2.ping 3.tracert 4.nslookup 5.system")
sys_cmd=int(input("请输入选项编号[1/2/3/4/5]:"))
if sys_cmd==1:os.system("mstsc")
if sys_cmd==2:os.system("ping baidu.com")
if sys_cmd==2:os.system("tracert -d baidu.com")
if sys_cmd==2:os.system("nslookup baidu.com")
if sys_cmd==5:
print('当前路径:',os.getcwd())
print('目录文件:',os.listdir())
print('nslookup:',os.system('nslookup qq.com'))
def ch_file():
print("2222222222222222")
def ch_db():
cx=sqlite3.connect("c:/1.db3")
cu=con.cursor()
cu.execute("select * from City;")
print (cu.fetchall())
def sqlmy():
engine = create_engine('sqlite:////D:\\1.db3',echo=True)
for name in session.query(city.name):
print(name)
print(session.query(User).all())
def main():
try:
print(" 1.乘法表 2.成绩等级 3.系统命令 4.文件 5.db 6.sqlmy 9.退出 ")
m_list=int(input("请输入您的选项:"))
if m_list==1:q_99()
if m_list==2:ch_cj()
if m_list==3:ch_sys()
if m_list==4:ch_file()
if m_list==5:ch_db()
if m_list==6:sqlmy()
if m_list==9:exit(1)
except:
main()
if __name__=='__main__':
while True:
print("\n\n----------------------------------")
main()
os.system("cls")