将.data文件加载到Python中并将其居中

将.data文件加载到Python中并将其居中,python,Python,我正在尝试将.data文件加载到python代码中。 加载后,我需要使用center()函数将其居中。 你是怎么做到的 file_object = open("cloud.data",'r') print (file_object) new_file_object = file_object.center(5) print (new_file_object) 可能与.data文件完全相同吗?

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

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

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

可能与.data文件完全相同吗?