Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
test-vscode-c-win
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸大学计算机学院
教师群组
赵鹏翀-zpc
test-vscode-c-win
提交
51e28859
提交
51e28859
3月 12, 2021
创建
作者:
宋海霞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify
上级
d8688af6
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
5 行删除
+17
-5
.gitignore
.gitignore
+4
-0
settings.json
.vscode/settings.json
+0
-3
local_test_c.py
local_test_c.py
+11
-2
readme.md
readme.md
+2
-0
没有找到文件。
.gitignore
0 → 100644
浏览文件 @
51e28859
*.exe
*.o
*.bak
\ No newline at end of file
.vscode/settings.json
deleted
100644 → 0
浏览文件 @
d8688af6
{
}
\ No newline at end of file
local_test_c.py
浏览文件 @
51e28859
...
@@ -11,7 +11,7 @@ import subprocess
...
@@ -11,7 +11,7 @@ import subprocess
import
platform
import
platform
# 使用此文件的目录作为当前工作目录
# 使用此文件的目录作为当前工作目录
os
.
chdir
(
os
.
path
.
dirname
(
__file__
))
#
os.chdir(os.path.dirname(__file__))
from
colorama
import
Fore
,
init
,
AnsiToWin32
from
colorama
import
Fore
,
init
,
AnsiToWin32
init
(
wrap
=
False
)
init
(
wrap
=
False
)
...
@@ -109,7 +109,9 @@ if __name__ == "__main__":
...
@@ -109,7 +109,9 @@ if __name__ == "__main__":
print
(
"开发环境中的 Python 解释器版本号:"
+
platform
.
python_version
())
print
(
"开发环境中的 Python 解释器版本号:"
+
platform
.
python_version
())
print
(
"环境变量中的 Python 解释器版本号:"
,
end
=
' '
)
print
(
"环境变量中的 Python 解释器版本号:"
,
end
=
' '
)
execResult
=
os
.
system
(
"python --version"
)
execResult
=
os
.
system
(
"python --version"
)
if
execResult
!=
0
:
if
execResult
!=
0
:
print
(
Fore
.
RED
+
"应用程序异常,返回值:{0}。"
.
format
(
execResult
),
file
=
stream
,
end
=
''
)
print
(
Fore
.
RED
+
"应用程序异常,返回值:{0}。"
.
format
(
execResult
),
file
=
stream
,
end
=
''
)
print
(
Fore
.
WHITE
,
file
=
stream
)
print
(
Fore
.
WHITE
,
file
=
stream
)
...
@@ -131,7 +133,13 @@ if __name__ == "__main__":
...
@@ -131,7 +133,13 @@ if __name__ == "__main__":
if
not
os
.
path
.
isfile
(
outputFile
):
if
not
os
.
path
.
isfile
(
outputFile
):
break
break
print
(
"正在使用文件 {0} 验证 case{1}"
.
format
(
inputFile
,
seqNum
))
print
(
"正在使用文件 {0} 验证 case{1}"
.
format
(
inputFile
,
seqNum
))
runCommand
=
"make && app.exe < {0} > {1}"
.
format
(
inputFile
,
useroutputFile
)
if
platform
.
system
()
.
lower
()
==
'windows'
:
runCommand
=
"make && app.exe < {0} > {1}"
.
format
(
inputFile
,
useroutputFile
)
elif
platform
.
system
()
.
lower
()
==
'linux'
:
runCommand
=
"make && ./app.exe < {0} > {1}"
.
format
(
inputFile
,
useroutputFile
)
execResult
=
os
.
system
(
runCommand
)
execResult
=
os
.
system
(
runCommand
)
if
execResult
!=
0
:
if
execResult
!=
0
:
print
(
Fore
.
RED
+
"应用程序异常,返回值:{0}。"
.
format
(
execResult
),
file
=
stream
,
end
=
''
)
print
(
Fore
.
RED
+
"应用程序异常,返回值:{0}。"
.
format
(
execResult
),
file
=
stream
,
end
=
''
)
...
@@ -141,6 +149,7 @@ if __name__ == "__main__":
...
@@ -141,6 +149,7 @@ if __name__ == "__main__":
if
os
.
path
.
isfile
(
outputFile
)
and
os
.
path
.
isfile
(
useroutputFile
):
if
os
.
path
.
isfile
(
outputFile
)
and
os
.
path
.
isfile
(
useroutputFile
):
if
compare_file
(
outputFile
,
useroutputFile
,
seqNum
)
==
0
:
if
compare_file
(
outputFile
,
useroutputFile
,
seqNum
)
==
0
:
print
(
"正在使用浏览器打开文件比较结果,可帮助用户查找验证失败的原因。"
)
print
(
"正在使用浏览器打开文件比较结果,可帮助用户查找验证失败的原因。"
)
print
(
Fore
.
RED
+
"注意:如果读者是在jupyterlab中完成实验,请使用以下方式打开文件比较结果:
\n
选择View菜单中的Explorer菜单项,在打开的文件列表中,右击result_comparation.html文件,
\n
在弹出的菜单中选择“Open Preview”菜单项,可以打开文件比较结果,可帮助用户查找验证失败的原因。"
)
# 使用浏览器打开比较结果页面
# 使用浏览器打开比较结果页面
webbrowser
.
open
(
'file://'
+
os
.
path
.
realpath
(
compResultFile
))
webbrowser
.
open
(
'file://'
+
os
.
path
.
realpath
(
compResultFile
))
break
break
...
...
readme.md
0 → 100644
浏览文件 @
51e28859
# 求分段函数
\ No newline at end of file
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论