五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

小學(xué)生用Python寫的系統(tǒng)[源碼]

2023-08-20 22:21 作者:米米耿  | 我要投稿

視頻地址:https://www.bilibili.com/video/BV1ap4y1n7DG


try:

? ? import os

? ? def helps():

? ? ? ? print("""Lesh [0.0.1] Le 2023-8

help\t顯示幫助

run\t運(yùn)行程序

cd\t切換目錄

dir\t查看當(dāng)前目錄下的文件

cmd\t運(yùn)行控制臺(tái)命令

set\t建立變量

echo\t輸出文本

print\t輸出變量

list\t查看所有變量

del\t刪除變量

exit\t退出

# 命令參數(shù)使用$代替空格""")


? ? def run(file):

? ? ? ? os.popen('"'+file+'"')


? ? def cd(cd):

? ? ? ? try:

? ? ? ? ? ? if cd == "..":

? ? ? ? ? ? ? ? os.chdir(os.path.abspath('..'))

? ? ? ? ? ? else:

? ? ? ? ? ? ? ? os.chdir(os.path.abspath(os.curdir) + "\\" + cd)

? ? ? ? except FileNotFoundError:

? ? ? ? ? ? print("找不到目錄",cd)


? ? def listdir():

? ? ? ? listdir = os.listdir()

? ? ? ? for i in listdir:

? ? ? ? ? ? print(i)


? ? def listver(vers):

? ? ? ? for i in vers:

? ? ? ? ? ? print(i + "\t" + vers[i])


? ? vers = {}

? ? helps()

? ? cmds = ["help","run","cd","dir","cmd","set","echo","print","list","del","exit"]

? ? while True:

? ? ? ? cmd = input(os.path.abspath(os.curdir) + ">").split(" ")

? ? ? ? try:

? ? ? ? ? ? if cmd[0] in cmds:

? ? ? ? ? ? ? ? if cmd[0] == cmds[0]: helps()

? ? ? ? ? ? ? ? elif cmd[0] == cmds[1]: run(cmd[1].replace("$"," "))

? ? ? ? ? ? ? ? elif cmd[0] == cmds[2]: cd(cmd[1].replace("$"," "))

? ? ? ? ? ? ? ? elif cmd[0] == cmds[3]: listdir()

? ? ? ? ? ? ? ? elif cmd[0] == cmds[4]: print(os.popen(cmd[1].replace("$"," ")).read())

? ? ? ? ? ? ? ? elif cmd[0] == cmds[5]: vers[cmd[1].replace("$"," ")] = cmd[2].replace("$"," ")

? ? ? ? ? ? ? ? elif cmd[0] == cmds[6]: print(cmd[1].replace("$"," "))

? ? ? ? ? ? ? ? elif cmd[0] == cmds[7]: print(vers[cmd[1].replace("$"," ")])

? ? ? ? ? ? ? ? elif cmd[0] == cmds[8]: listver(vers)

? ? ? ? ? ? ? ? elif cmd[0] == cmds[9]: vers.pop(cmd[1].replace("$"," "),)

? ? ? ? ? ? ? ? elif cmd[0] == cmds[10]: break

? ? ? ? ? ? else:

? ? ? ? ? ? ? ? print(cmd[0],"不是命令")

? ? ? ? except IndexError:

? ? ? ? ? ? print(cmd[0],"命令需要參數(shù)")

? ? ? ? except KeyError:

? ? ? ? ? ? print("沒有",cmd[1].replace("$"," "),"變量")

except:

? ? print("發(fā)生未知錯(cuò)誤")


小學(xué)生用Python寫的系統(tǒng)[源碼]的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
赣州市| 廊坊市| 贡觉县| 公主岭市| 抚远县| 建宁县| 永泰县| 鹤壁市| 沁水县| 汽车| 桓仁| 略阳县| 邹城市| 乐昌市| 保靖县| 辽阳县| 哈巴河县| 北安市| 吉水县| 丘北县| 巨野县| 手机| 分宜县| 麻阳| 沁阳市| 博白县| 翁牛特旗| 弥勒县| 三穗县| 桐乡市| 赣州市| 当阳市| 大埔区| 周至县| 大洼县| 湖北省| 林州市| 望奎县| 肥乡县| 台安县| 汶上县|