Here is code to execute these printing commands from file:

talk("How Are You")
bark("I am fine")
bark("...and how are you")
snarl("...sorry I asked")

from file INPUT, do printing of results to screen without tags and to file with tags, and open the html output with webbrowser.

Edited 5 Years Ago by Narue: Requested by author

from __future__ import print_function

import os

import webbrowser

OUTPUT, INPUT = 'output.html', 'talk.txt'

def print_and_save(*args, **kwargs):
    """ Echo args to output.html with tags and console without them """
    if 'tag' in kwargs:
       tag = kwargs['tag']
       del kwargs['tag']
       print(tag + ' '.join(args) + tag[0] + '/' + tag[1:] + '</br>',
             file=open(OUTPUT, 'a'),
         print(' '.join(args)+'</br>', file=open(OUTPUT, 'a'), **kwargs)

    print(' '.join(args), **kwargs)

def talk(arg):

def bark(arg):
    print_and_save(arg, tag='<b>')

def snarl(arg):
    print_and_save(arg, tag='<i>')

def main():
    print('<html><body>', file=open(OUTPUT, 'w'))
    print('\n</body> </html> ', file=open(OUTPUT, 'a'))


IT/Science/Contracts/Religious translation/interpreting FIN-ENG-FIN
Python programming