336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

#! -*- coding:utf-8 -*-

def scriptinfo():
  import os, sys, inspect

  for teil in inspect.stack():
    if teil[1].startswith("<"):
      continue
    if teil[1].upper().startswith(sys.exec_prefix.upper()):
      continue
    trc=teil[1]

  if getattr(sys, 'frozen',False):
    scriptdir, scriptname=os.path.split(sys.executable)
    return {"dir":scriptdir,
            "name":scriptname,
            "source":trc}

  scriptdir, trc=os.path.split(trc)

  if not scriptdir:
    scriptdir=os.getcwd()

  scr_dict={"name":trc,
            "source":trc,
            "dir":scriptdir}

  return scr_dict

================================================

===========   scriptinfoUsage.py   ======================


#! -*- coding: utf-8 -*-

import scriptinfo as ss

print ss.scriptinfo()



'Python' 카테고리의 다른 글

oscylator.py  (0) 2015.02.08
textToImage.py  (0) 2015.02.08
IMDB.py  (0) 2015.02.08
hanGame.py  (0) 2015.02.08
curIP.py  (0) 2015.02.08
Posted by af334