Python in a browser?

The future of web creation is here, whilst its marketing campain as a Javascript killer is a little ambitious at the moment Py-Script makes it possible to run Python in a web browser and having a little play with it has made me realise I needed this more than I thought. I have made a stupid simple python website that gives you 6 random numbers you could use on the lotto I call it “UK LOTTO NUMBER PICKER IN PYTHON” I know im a legend at naming projects. All jokes aside If you want to use it the link is:

I will not be reviewing Py-Script as its unfair to do that at this stage as its in very early Alpha stages and its buggy and not to be used on production websites, we will ignore the fact I have used it on this website side bar 😉 Not to mention the fact it has 0 documentation yet!

the code I used to make this is below:

    <link rel="stylesheet" href="" />
    <script defer src=""></script>
    alert("This entire website was made with Python, CSS & HTML. The only Javascript is this box your reading now");
  <div html>
<title>Lotto number picker | Python</title>
   <div class="centered">
import random

numbers = [
    random.randrange(1, 59),
    random.randrange(1, 59),
    random.randrange(1, 59),
    random.randrange(1, 59),
    random.randrange(1, 59),
    random.randrange(1, 59)
print("UK Lotto number picker in Python")
print("I give you 6 random numbers from 1 to 59 every time you refresh its up to you what you play :)")
print(f'{numbers[0]} :: {numbers[1]} :: {numbers[2]} :: {numbers[3]} :: {numbers[4]} :: {numbers[5]}')
print ("If you win remember this websites owner, hahaha")
print(" - ")
print(" - ")
print(" - ")
print("A huge thank you to Py-Script for making this possible")

html {
  background-color: #6495ED; 

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  font-size: large;
  /* bring your own prefixes */
  transform: translate(-50%, -50%);

div {
  background-color: #00BFFF;

Honestly this is the most exciting thing to happen to web development in a long time and I have high hopes for the Py-Script project!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *