Advertisement
adolphuZ

Untitled

Jun 5th, 2024
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. def create_html_file():
  2.     builder = HtmlBuilder()
  3.     elements = [StyledDiv(Div()), StyledLabel(Label()), StyledInput(Input()), StyledSelect(Select()), StyledSubmit(Submit())]
  4.    
  5.     for element in elements:
  6.         builder.add_element(element)
  7.    
  8.     with open("form.html", "w") as file:
  9.         file.write(builder.get_html())
  10.  
  11. def create_css_file():
  12.     builder = CssBuilder()
  13.     styles = [ColoredDivStyle(DivStyle()), ColoredLabelStyle(LabelStyle()), ColoredInputStyle(InputStyle()), ColoredSelectStyle(SelectStyle()), ColoredSubmitStyle(SubmitStyle())]
  14.    
  15.     for style in styles:
  16.         builder.add_style(style)
  17.    
  18.     with open("styles.css", "w") as file:
  19.         file.write(builder.get_css())
  20.  
  21. def main():
  22.     create_html_file()
  23.     create_css_file()
  24.  
  25. if __name__ == "__main__":
  26.     main()
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement