首页 > 解决方案 > 将 .data 文件加载到 Python 中并将其居中

问题描述

我正在尝试将 .data 文件加载到我的 python 代码中。加载后,我需要使用 center() 函数将其居中。你怎么做到这一点?

file_object = open("cloud.data",'r')
print (file_object)

new_file_object = file_object.center(5)
print (new_file_object)

标签: python

解决方案


推荐阅读