#!/usr/bin/python
# -*- coding: UTF-8 -*-
import platform,os
import time
import subprocess
import sys
import ctypes
def get_sysinfo():
sys = platform.system()
return os.getpid(),sys
def get_path():
p=os.path.split(os.path.realpath(__file__)) # ('D:\\workspace\\python\\src\\mysql', 'dao.py')
p=os.path.split(p[0])
if not p:
os.mkdir(p)
return p[0]
def get_pid_path():
return get_path() +'/tmp/yqs.pid'
def check_pid(pid = 0,osname=''):
if pid is None or pid == 0:
return False
wincmd = 'tasklist /FI "PID eq %s" /FI "IMAGENAME eq python.exe "' % str(pid)
lincmd = 'ps ax |grep %s |grep python' % str(pid)
cmd,size = (wincmd,150) if osname==&#