python - 是否可以更改外部库保存的文件的保存路径?
问题描述
我在 python 中使用了一个名为的库pyansys
,其中我使用了一个名为save_as_vtk
.
它是:文档
此方法为我生成一个文件并将其保存到我的工作目录中。我希望将该文件保存在其他地方...我不希望它移动,因为有时它是 20+ Gb 并且需要太长时间。
有人有想法吗?
谢谢!
解决方案
我是pyansys
包的维护者。
这在https://github.com/akaszynski/pyansys/issues/219中得到了回答
在这里重复:
看来 ResultFile.save_as_vtk 已经有一个文件名参数:
def save_as_vtk(self, filename, rsets=None, result_types=['ENS']):
"""Writes results to a vtk readable file.
The file extension will select the type of writer to use.
``'.vtk'`` will use the legacy writer, while ``'.vtu'`` will
select the VTK XML writer.
Parameters
----------
filename : str
Filename of grid to be written. The file extension will
select the type of writer to use. ``'.vtk'`` will use the
legacy writer, while ``'.vtu'`` will select the VTK XML
writer.
推荐阅读
- java - 我可以使用原始类作为类型并仍然使用它的子类吗?
- html - .card 类中的列不会相互内联
- react-native - 在主容器上使用带有填充的 KeyboardAvoidingView
- python-3.x - create dataframe using the values from csv file, (Displays NaN values)
- java - Spring application from Standalone class without deploying WAR
- javascript - How to get specific number from table using selenium if location is static for every zip code?
- react-native - 如何运行基于 expo 构建的聊天应用程序的两个不同实例?
- python-3.x - 通过剥离在熊猫中格式化日期时间值
- python - 如何找到两个csv之间的差异总和
- r - 如何使用 rvest 获取动态 html 标签?