Browse Source

add except

master
tzquant_zq 3 months ago
parent
commit
e351ce8d99
1 changed files with 14 additions and 10 deletions
  1. +14
    -10
      tz_crypto_bt.py

+ 14
- 10
tz_crypto_bt.py View File

@ -1,21 +1,25 @@
# -*- coding: utf-8 -*-
# tzquant
import site
import os
import shutil
import numpy as np
# 定义要移动的目录列表
directories_to_move = ['tz_ctastrategy', 'tzquant', 'tzqtdatahub', 'tz_riskmanager', 'gate_api', 'clients']
# 获取numpy模块的__file__属性,它包含了numpy模块文件的路径
numpy_file_path = np.__file__
# 使用os.path模块来获取numpy所在的目录
numpy_dir = os.path.dirname(numpy_file_path)
# 获取numpy所在目录的上层目录
parent_dir = os.path.dirname(numpy_dir)
try:
# 获取numpy模块的__file__属性,它包含了numpy模块文件的路径
numpy_file_path = np.__file__
# 使用os.path模块来获取numpy所在的目录
numpy_dir = os.path.dirname(numpy_file_path)
# 获取numpy所在目录的上层目录
parent_dir = os.path.dirname(numpy_dir)
except Exception as e:
parent_dir = os.path.dirname(site.getsitepackages()[0]+'/')
print(f"Error: {e}")
# 打印上层目录,用于验证
print("NumPy所在目录的上层目录是: ", parent_dir)


Loading…
Cancel
Save