Pyh:python Generating HTML

Source: Internet
Author: User

Reference: Python pyh Module Chinese documentation

1. Use your own CSS or JS File.

Write your own CSS and JS files, such as mystyle.css, myjs.js, and so On.

 from Import *= pyh ('Study pyh') page.addcss ('  Mystyle1.css'mystyle2.css') page.addjs (' Myjs1.js ' ' Myjs2.js ' ) page.printout ()

2. Using labels

For example, using

Page << H1 (' Test total time consuming ')

3. Define the ID of the label

Mydiv = div (id='id1')

Or

Mydiv = Div () mydiv.attributes['ID'id2'

4. Define the class of the label

Mydiv = div (cl='Class1 class2')

5. Define the Value/text of the label

Mydiv = div ('Save')

6. Tag Nesting

For example, Div contains P.

Mydiv = div (p ('I am Tag p. '), cl='Class1 class2', id='id1')

7. Connect multiple tabs via +

Page << p (' number of successful cases:'+str (self.success_num) +' " *10+' failure case number:'+str (self.fail_num) +'*10+'  ' number of error cases:'+str (self.error_num))

Pyh:python Generating HTML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.