def get_td(self, col, data): if col == 'itemId': url = "https://weidian.com/item.html?itemID=" + str(data) res = td(li(a(href=url, target="_blank")(data))) elif col == 'shopId' or col == 'sellerId': url = "https://weidian.com/?userid=" + str(data) res = td(li(a(href=url, target="_blank")(data))) elif ("img" in col) or ("image" in col): res = td(img(src=data + "?w=150&h=150&cp=1")) else: res = td(data) return res
def hello(): example_form = form(action="goodbye")(label( "Enter a message:", input_(type="text", name="message"), input_(type="submit"))) response = html( body( h1("Welcome"), p("Hello, how are you?"), # <a href="https://google.com">Go to google</a> a(href="https://google.com")("Go to google"), img(src="https://source.unsplash.com/J1E6XzW1INk", width=500), example_form)) return str(response)
'''Creating new HTML page named index.html using pyhtml module''' import pyhtml hr = pyhtml.hr() #hr tag br = pyhtml.br() #br tag title = pyhtml.title("GSoc") #title tag h1_1 = pyhtml.h1("Manasvi Saxena") #h1 tag a1 = pyhtml.a("*****@*****.**", "*****@*****.**") #link tag a2 = pyhtml.a("https://github.com/minusv23", "Github") #link tag h2_1 = pyhtml.h2("Education") #h2 tag h4_1 = pyhtml.h4( "B. TECH | 2015-2019 | JAYPEE UNIVERSITY OF ENGINEERING AND TECHNOLOGY, GUNA" ) #h4 tag p_1 = pyhtml.para("Electronics and Communication, CGPA: 8.7") #p tag h2_2 = pyhtml.h2("Skills") #h2 tag h3_1 = pyhtml.h3("Programming Language") #h3 tag p_2 = pyhtml.para("Python, C and C++") #p tag h3_2 = pyhtml.h3("Web Development") #h3 tag p_3 = pyhtml.para("HTML, CSS, Bootstrap, Django") #p tag h3_3 = pyhtml.h3("Operting Systems") #h3 tag p_4 = pyhtml.para("Microsoft Windows and Linux") #p tag
def f_links(ctx): for title, page in [('Home', '/home.html'), ('Login', '/login.html')]: yield ph.li(ph.a(href=page)(title))
def f_links(ctx): for title, page in menuElements: yield ph.li(ph.a(href=page)(title))