Skip to content

Commit 96382fd

Browse files
Merge pull request #88 from jinwandalaohu66/submission/cmd1_0_mnirvpz0
2 parents bf22f98 + 142ad0a commit 96382fd

2 files changed

Lines changed: 117 additions & 2 deletions

File tree

script_library/index.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 1,
3-
"data_version": 64,
4-
"updated": "2026-04-03T09:05:24.054Z",
3+
"data_version": 65,
4+
"updated": "2026-04-03T10:40:27.436Z",
55
"announcement": null,
66
"categories": [
77
{
@@ -1259,6 +1259,29 @@
12591259
"updated": null,
12601260
"status": "removed",
12611261
"lines": 650
1262+
},
1263+
{
1264+
"id": "cmd1_0_mnirvpz0",
1265+
"name": "模拟cmd1.0",
1266+
"name_en": "模拟cmd1.0",
1267+
"desc": "一个模拟cmd的小脚本,为了方便改了一点语法,暂时只有这些功能english:A small script that simulates cmd. In order to facilitate a little syntax, it only has these functions for the time being.",
1268+
"desc_en": "一个模拟cmd的小脚本,为了方便改了一点语法,暂时只有这些功能english:A small script that simulates cmd. In order to facilitate a little syntax, it only has these functions for the time being.",
1269+
"category": "basic",
1270+
"file": "scripts/basic/cmd1_0_mnirvpz0.py",
1271+
"thumbnail": null,
1272+
"version": 1,
1273+
"file_type": "py",
1274+
"author": "ioo",
1275+
"author_en": "ioo",
1276+
"tags": [
1277+
"community"
1278+
],
1279+
"requires": [],
1280+
"min_app_version": "1.5.0",
1281+
"added": "2026-04-03",
1282+
"updated": null,
1283+
"status": "active",
1284+
"lines": 93
12621285
}
12631286
]
12641287
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# 欢迎使用 PythonIDE!如果觉得好用,请给个好评哦~
2+
# cmd简练版
3+
R = "\033[91m" # 红
4+
G = "\033[92m" # 绿
5+
Y = "\033[93m" # 黄
6+
B = "\033[94m" # 蓝
7+
C = "\033[96m" # 青
8+
M = "\033[95m" # 紫
9+
X = "\033[0m"
10+
new_l = "\n"
11+
cmd = ""
12+
13+
show = ">"
14+
file={"command.com":"bin,can't see",
15+
"io.sys":"bin,can't see",
16+
"msdos.sys":"bin,can't see",
17+
"ms.txt":"hello user!",
18+
"sys.txt":"看到这个的人我祝福他幸福快乐每一天",
19+
"thank.xz":"敢看嘛,其实是感谢使用",
20+
"format.bat":"format"
21+
}
22+
print("DOS改版")
23+
24+
print("输入help以了解命令")
25+
while True:
26+
27+
cmd = input(show).strip() #del " "
28+
if not cmd == "\n":
29+
# help
30+
if cmd.startswith("help"):
31+
print("echo 打印文字,如echo hello")
32+
print("echo on 开启提示符,echo off 关闭提示符")
33+
print("dir显示文件")
34+
print("type显示文件内容")
35+
print("del可以删除文件,无需路径")
36+
print("我自定义了文件的写入方式")
37+
print("add file-text")
38+
print("new file name")
39+
print("exit 退出程序")
40+
print("(del如果显示文件名就是删除成功)")
41+
#echo
42+
elif cmd.startswith("echo"):
43+
input_str = cmd[4:].lstrip()
44+
if input_str.startswith("on"):
45+
show = ">"
46+
elif input_str.startswith("off"):
47+
show = ""
48+
else:
49+
print(input_str)
50+
# exit
51+
elif cmd == "exit":
52+
53+
exit()
54+
elif cmd=="dir":
55+
print(R+"file:")
56+
print(B)
57+
for i in list(file):
58+
print(" "+i)
59+
print(G+"file number:"+str(len(file)));print(X)
60+
elif cmd == "oaoa":
61+
print(G+"91*10086=917826");print(X)
62+
# 在命令判断里加一段
63+
elif cmd.startswith("cls"):
64+
for I in range(1145):
65+
print("\a")
66+
elif cmd.startswith("type"):
67+
print(file.get(cmd[5:],"无法找到此文件"))
68+
elif cmd.startswith("del"):
69+
if not cmd.endswith(".sys"):
70+
if file.pop(cmd[4:],False):
71+
72+
73+
74+
bool=True
75+
else:
76+
bool=False
77+
print("try del file:"+cmd[4:] if bool else "cannot find or del this file")
78+
elif cmd.startswith("add"):
79+
try:
80+
file[cmd[4:]]+=input(">>text")
81+
except:
82+
file[cmd[4:]]=input(">>text")
83+
elif cmd.startswith("new"):
84+
name=cmd[4:]
85+
text=input(">>text")
86+
file[name]=text
87+
else:
88+
if cmd=="\n":
89+
continue
90+
else:
91+
92+
print(f"'{cmd}' 不是内部或外部命令,也不是可运行的程序")

0 commit comments

Comments
 (0)