Skip to content

15seconds

focus on your self in life

15seconds

Month: April 2021

get pid(process id)

$ ps -ef | grep python

501 922 870 0 8:15PM ttys000 0:00.07 python $ python

>>> import os

>>> print os.getpid()

922 <- 해당 Python의 PID값

>>> import psutil

>> psutil.Process(os.getpid()).ppid()

870 <- 해당 Python의 Parent PID값

출처: https://info-lab.tistory.com/110 [:: IT School ::]

Author CharlesPosted on April 3, 2021April 3, 2021Categories PythonLeave a comment on get pid(process id)

Recent Posts

  • install Oracle 11g on CentOS7
  • Installing Oracle 11g in CentOS 7
  • Hyper-v using fixed IP in virtual environment
  • statcked chart chart.js
  • postgreSQL

Recent Comments

    Archives

    • January 2023
    • November 2022
    • April 2022
    • March 2022
    • January 2022
    • December 2021
    • November 2021
    • October 2021
    • August 2021
    • April 2021
    • June 2020
    • May 2020
    • March 2020
    • June 2018
    • July 2017
    • April 2017
    • February 2017
    • January 2017
    • December 2016
    • April 2016
    • March 2016
    • February 2016
    • December 2015

    Categories

    • Bookmark
    • iis & asp & windows
    • iOS swift
    • Java jsp spring
    • Javascript & Jquery & React & Angular
    • Linux
    • MariaDB MySQL
    • MSSQL
    • Oracle
    • php & nodejs
    • planning & design
    • Python
    • Security
    • SystemAndNetwork
    • 잊혀질 시간의 시

    Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
    15seconds Proudly powered by WordPress