Python & JavaScript? | Website Creator...

/ 15 Aug 2013 /
Yes, I know, I'm a genius.



with open('index.html', 'w') as html:
    title = input('Title of the page? ').capitalize()
    h2 = input('Heading for your website: ').capitalize()
    p1 = input('First paragraph: ').capitalize()
    p2 = input('Second paragraph: ').capitalize()
    a = '''
<html>
    <head>
        <link href="css/bootstrap.css" rel="stylesheet">
        <style>
        div {{
 left: 300px;
 position: absolute;
 height: 400px;
 width: 300px;
 border: 2px solid #6495ed;
 background-color: #BCD2EE;
 border-radius: 5px;
}}
        
        </style>
        <title> {} </title>
    </head>
    <body>
        <center>
        <h2> {} </h2>
        </center>
        <div>
            <p style='position: relative; left: 5px'> {} </p>
            <p style='position: relative; left: 5px'> {} </p>
            <input style='position: relative; left: 100px' type='button' value='test' onClick='Button()'>
            <p style='position: relative; left: 100px' id='p3'> </p>
        </div>
        <script>
        function Button() 
            {{document.getElementById('p3').innerHTML = '<br> Test';}}
        
        </script>
    </body>
</html>
'''.format(title, h2, p1, p2)
    html.write(a)


Now obviously this is very brief test, I'l be making a GUI version of this soon, can not wait.
 
Copyright © 2010 M(ath)+me, All rights reserved