Skip to content

Eternal Center

  • System (系统)
  • Services (服务)
  • Databases (数据库)
  • Clusters (集群)
  • Big Data (大数据)
  • Cloud Computing (云计算)
  • Languages (语言)
  • Project (项目)
  • Writings (写作)
  • Eternity (永恒)
  • News (消息)
  • Chronicle (编年史)
  • Words (言)

Category: Python Fun (娱乐)

Posted on May 3, 2020December 26, 2021

[娱乐] Python 截取 Linux 命令输出结果中某一行的某一列

介绍:

使用方法:
1. 给此脚本添加执行权限
2. 执行此脚本

脚本:

#!/usr/bin/python3

import os
  
column1=os.popen("ls -arthl / | head -4 | tail -1 |awk '{print $1}'").read()
column1=column1.strip('\n')

column9=os.popen("ls -arthl / | head -4 | tail -1 |awk '{print $9}'").read()
column9=column9.strip('\n')

print(column1,column9)

Aspiration (愿景):

Everyone can achieve self achievement and self happiness fairly

每个人都能公平地实现自我成就和自我幸福

Position (位置):

Running on Evolution Host and DigitalOcean

正在 Evolution Host 和 DigitalOcean 上运行

Logo (徽标):

Additional Information (其他信息):

About Manual Clone Contact Disclaimer Donation Friendly Links 关于 说明书 克隆 联系 免责申明 捐赠 友情链接

Standby IP Address (备用 IP 地址):

152.69.204.95  150.230.63.10  Please configure before use / 请先配置再使用

Search Outside Website (站外搜索):

Google Wikipedia Bing
Proudly powered by LNMP Proudly powered by WordPress