#!/usr/bin/env python3

'''Compile a Python script and generate a documentation file

Synopsis: pyc.py filename.py

Both the compiled bytecode and HTML documentation file
are written to the current working directory.

Example:

pyc.py dnapars.py

creates the files dnapars.pyc and dnapars.html.

''' 


import subprocess
import py_compile
import sys


file = str(sys.argv[1])
py_compile.compile(file)


if file.endswith('.py') :
   fname = file[:-3]
else :
   fname = file
   
subprocess.call(['pydoc', '-w', fname])  

#pydoc -w fname

