[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
creative personal sites
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 14
Thread images: 1
File: python-django.png (8 KB, 211x192) Image search: [Google]
python-django.png
8 KB, 211x192
Hey, I wanna put a version of snake in a 404 page, and I already have a version of snake I programmed in Python (tkinter GUI).

How would I get my sweet 404 page up?

> inb4 "use javascript"
> inb4 "answer not found"
>>
>>54517193
are you literally retarded? the only way you can create a inbrowser game is by using javascript.
>>
>>54517219
Or have it on the JVM
>>
>>54517219
You got me.
I'm literally retarded.

So, this is a question about recycling code.
Yes, I am aware that browsers only load html and that the script tag only embeds Javascript. Note how the picture is Django, though -- Django's ORM and Template Language enable Python code to be converted to html.
The solution would clearly not be anywhere near this simple, because we're talking about an embedded GUI, but there are ways of tweaking things.
>>
>>54517314
Nah
>>
>>54517314
you do know that html is a markup language? the only thing that you would need for a snake game (I assume like the Nokia game), is 1 single html element (canvas) and lots of javascript code.
>>
>>54517452
I'm not sure what "lots" means.

I can do it in ~150 lines of python, but JS bugs me and probably takes a few more lines. Regardless, there's a tutorial for exactly what you describe, here:
http://thecodeplayer.com/walkthrough/html5-game-tutorial-make-a-snake-game-using-html5-canvas-jquery
>>
>>54517543
well then you dont need to do anything, just copy the code
>>
webgl?
>>
>>54517695
>3d graphic library for 2d game
>>
>>54517756
well considering OP is putting pointless shit into status pages why not go all the way
>>
>>54517314
>>>54517219
>You got me.
>I'm literally retarded.
>So, this is a question about recycling code.
>Yes, I am aware that browsers only load html and that the script tag only embeds Javascript. Note how the picture is Django, though -- Django's ORM and Template Language enable Python code to be converted to html.
>The solution would clearly not be anywhere near this simple, because we're talking about an embedded GUI, but there are ways of tweaking things.

Not possible. Just learn JavaScript. It's a fun language.
>>
>>54517951
>It's a fun language.

);});}

:(
>>
>>54517314

>..enable Python code to be converted to html.

And that's the point.

A game works mostly on the client side, so you need to write it in something that runs IN THE BROWSER of the client. I doesn't matter if you have an python interpreter in your server.

So you have to take something like JavaScript or Flash.
Thread replies: 14
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.