SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Carousel
Whom takes fun only as fun.
And serious only seriously.
Misunderstood both.
Piet Hein

Classe Carousel

  1. Em Carousel.py:
    Python Listing: ../../Code/Carousel.py.
    from Tag import Tag
    from File import File_Read,File_Write
    
    class Carousel(Tag):
        Carousel_Header="Header.html"
        Carousel_Tailer="Tail.html"
    
        def Carousel_Generate(self,fname,title,files,resolution):
            html=[]
            html=html+File_Read(self.Carousel_Header)
            html=html+[ self.Tags("H1",title) ]
    
            tableoptions={
                "BORDER": '2px'
            }
            divoptions={
                "class": 'w3-content w3-section'
            }
            
            images=[]
            for file in files:
                img=self.Tag1(
                    "IMG",{
                        "class":  'mySlides',
                        "width":  resolution[0],
                        "height": resolution[1],
                        "src":    file,
                    }
                )
    
                images.append(img)
    
            div=self.Tags(
                "DIV",
                "\n".join(images),
                divoptions
            )
    
            div=self.Tags(
                "TABLE",
                self.Tags(
                    "TR",
                    self.Tags("TD",div)
                ),
                tableoptions
            )
            html=html+[ div ]
            html=html+File_Read(self.Carousel_Tailer)
            
            File_Write(fname,html,True)
    
Messages:
0 secs.