CentOS 6.x 에 Python 3 버전 설치하기

$ yum install -y https://repo.ius.io/ius-release-el6.rpm
$ yum install -y python36u python36u-libs python36u-devel python36u-pip
$ python3.6 -V
Python 3.6.8
$ rm -f /usr/bin/python3
$ ln -s /usr/bin/python3.6 /usr/bin/python3
$ python3
Python 3.6.8 (default, Aug 10 2019, 06:52:10) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Python 에서 ctags 분석

아래와 같이 ctags 로 코드를 분석하고..

ctags --languages=tcl --fields=afmikKlnsStz -R

생성된 ctags 파일을 python 에서 아래의 모듈을 아용하여 분석.

https://code.google.com/p/python-ctags/

SET VS90COMNTOOLS=%VS100COMNTOOLS%
python setup.py install

테스트

import ctags
from ctags import CTags, TagEntry
import sys

tagFile = CTags('tags')
entry = TagEntry()

if tagFile.find(entry, 'legend', ctags.TAG_PARTIALMATCH | ctags.TAG_IGNORECASE):
	print entry['lineNumber']
	print entry['file']
	print entry['pattern']
	print entry['name']
	print entry['kind']

	# Find the next tag matching the name and options supplied to the 
	# most recent call to tagFile.find().  (replace the entry if found)
	while tagFile.findNext(entry):
		print entry['lineNumber']
		print entry['file']
		print entry['pattern']
		print entry['name']
		print entry['kind']