DEV Community

Medea
Medea

Posted on

HTML + JS + Python = hard

So I’m going to make a game in Python where you hear chords/notes and you have to figure out what note it is.

I’ve already written the script for creating the note sounds, and I’ll probably save all the notes to a audio file each.

For the rules, I’ll give one minute to the user to do as many notes as they can do.

But the game will be rendered via HTML, and I’ll be saving best scores and stats in Python, so how will I connect them together?

I was thinking of doing the counting in JavaScript, choosing the random note in JavaScript, and save the score for the round in JavaScript via cookies. Then when the game ended, I could redirect to a url with the score so I could do the function in that url.
But that isn’t the best solution as that way anyone can go to the url and change their score, or they can use the console to change the cookie data anyways.
Is there a more secure way of doing this?
Thanks

Top comments (3)

Collapse
 
vulcanwm profile image
Medea

Thanks! I’ll try this out!

Collapse
 
dillonb07 profile image
Dillon Barnes

Not sure if it will be useful for you here, but you can check out PyScript which is a way of writing Python insider your HTML.

pyscript.net
github.com/pyscript/pyscript

Thread Thread
 
vulcanwm profile image
Medea

I’ll try that out! Thanks