You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
925 B
32 lines
925 B
import os
|
|
|
|
print("========================================")
|
|
print(" 基本测试")
|
|
print("========================================")
|
|
print(f"当前目录: {os.getcwd()}")
|
|
print(f"Python版本:")
|
|
|
|
# 执行Python版本检查
|
|
import sys
|
|
print(sys.version)
|
|
|
|
# 检查目录
|
|
print("\n检查目录:")
|
|
dir_path = r'D:\计量经济学\计量实验资料及作业要求\计量实验资料及作业要求'
|
|
print(f"目录: {dir_path}")
|
|
print(f"存在: {os.path.exists(dir_path)}")
|
|
|
|
# 列出文件
|
|
if os.path.exists(dir_path):
|
|
print("\n目录文件:")
|
|
files = os.listdir(dir_path)
|
|
for file in files[:15]:
|
|
file_path = os.path.join(dir_path, file)
|
|
if os.path.isfile(file_path):
|
|
size = os.path.getsize(file_path) / 1024
|
|
print(f" {file}: {size:.2f} KB")
|
|
|
|
print()
|
|
print("========================================")
|
|
print(" 测试完成")
|
|
print("========================================")
|
|
|