程序代写代做代考 Exercise 6-11 Personal Web Page Generator

Exercise 6-11 Personal Web Page Generator
def main():
name = input(‘Enter your name: ‘)
description = input(‘Describe yourself: ‘)

# Create the file.
html_file = open(‘my_page.html’, ‘w’)

# Write the HTML
write_html(html_file, name, description)

# Close the file.
html_file.close()

def write_html(html_file, name, description):
# Write the tag.
html_file.write(‘\n’)

# Write the element.
write_head(html_file)

# Write the body.
write_body(html_file, name, description)

# Write the tag.
html_file.write(‘\n’)

def write_head(html_file):
html_file.write(‘\n’)
html_file.write(‘My Personal Web Page\n’)
html_file.write(‘\n’)

def write_body(html_file, name, description):
html_file.write(‘\n’)
html_file.write(‘\t

\n’)
html_file.write(‘\t\t

‘)
html_file.write(name)
html_file.write(‘

\n’)
html_file.write(‘\t

\n’)
html_file.write(‘\t


\n\t’)
html_file.write(description)
html_file.write(‘\n\t


\n’)
html_file.write(‘\t\n’)

main()