Initial commit for TTS project
This commit is contained in:
29
scripts/tools/verify_env.py
Normal file
29
scripts/tools/verify_env.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
# 创建目录
|
||||
try:
|
||||
os.makedirs('/root/tts/test_dir', exist_ok=True)
|
||||
print('Directory created: /root/tts/test_dir')
|
||||
except Exception as e:
|
||||
print('Error creating directory:', e)
|
||||
|
||||
# 创建文件
|
||||
try:
|
||||
with open('/root/tts/test.txt', 'w') as f:
|
||||
f.write('Test content: 和而不同 天下大同\n')
|
||||
f.write('Timestamp: ' + str(time.time()) + '\n')
|
||||
print('File created: /root/tts/test.txt')
|
||||
except Exception as e:
|
||||
print('Error creating file:', e)
|
||||
|
||||
# 读取文件
|
||||
try:
|
||||
with open('/root/tts/test.txt', 'r') as f:
|
||||
content = f.read()
|
||||
print('File content:')
|
||||
print(content)
|
||||
except Exception as e:
|
||||
print('Error reading file:', e)
|
||||
Reference in New Issue
Block a user