python - 将 .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)
解决方案
推荐阅读
- reactjs - TypeError:this.setAttribute 不是函数
- vhdl - 尝试运行实现时 Vivado 中出现“Opt_Design 错误”
- php - 为什么在 Heroku 上找不到我的课程,而在本地环境中却找不到?
- javascript - 自定义输入组件忽略来自方法的更新
- android - 具有重复值的回收站更新
- c# - 即使输入不同,ASP.NET Web API 也会不断返回相同的结果
- javascript - Beautifulsoup 抓取中缺少 html
- macos - 在 MacOS Mojave 10.14 上未创建核心转储文件
- reactjs - 反应:上传多张图片
- r - r-exams:完形填空子项中的 R 输出格式