Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create_html_file():
- builder = HtmlBuilder()
- elements = [StyledDiv(Div()), StyledLabel(Label()), StyledInput(Input()), StyledSelect(Select()), StyledSubmit(Submit())]
- for element in elements:
- builder.add_element(element)
- with open("form.html", "w") as file:
- file.write(builder.get_html())
- def create_css_file():
- builder = CssBuilder()
- styles = [ColoredDivStyle(DivStyle()), ColoredLabelStyle(LabelStyle()), ColoredInputStyle(InputStyle()), ColoredSelectStyle(SelectStyle()), ColoredSubmitStyle(SubmitStyle())]
- for style in styles:
- builder.add_style(style)
- with open("styles.css", "w") as file:
- file.write(builder.get_css())
- def main():
- create_html_file()
- create_css_file()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement