If you do not have the option of installing python3, try this code:

#!/usr/bin/env python
import BaseHTTPServer, SimpleHTTPServer

port=8000
print "Running on port %d" % port
 SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map['.wasm'] =
 'application/wasm'
httpd = BaseHTTPServer.HTTPServer(('localhost', port),
    SimpleHTTPServer.SimpleHTTPRequestHandler)

print "Mapping \".wasm\" to \"%s\"" %
    SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map['.wasm']
httpd.serve_forever()


(Source: 
https://curiousprog.com/2018/10/08/serving-webassembly-files-with-a-development-web-server/)


On Fri, Jul 19, 2019 at 5:34 PM Joshua Moore <joshua.mo...@leudla.net>
wrote:

> It looks like you are using python 2, which will be deprecated in 2020. If
> you have the choice of installing python 3, the code above should work. Put
> the code in a script called something like "server.py", then run it via
> python3 server.py.
>
> On Fri, Jul 19, 2019 at 5:29 PM キャロウ マーク <git...@callow.im> wrote:
>
>>
>>
>> On Jul 19, 2019, at 17:23, Joshua Moore <joshua.mo...@leudla.net> wrote:
>>
>> Here, try this:
>> https://gist.github.com/prideout/09af26cef84eef3e06a1e3f20a499a48
>>
>>
>> Thanks but how do I add that to my Python?
>>
>> Regards
>>
>>     -Mark
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to emscripten-discuss+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/A6DF7DDF-A2C6-41ED-B8BA-2B2E83BC709A%40callow.im
>> <https://groups.google.com/d/msgid/emscripten-discuss/A6DF7DDF-A2C6-41ED-B8BA-2B2E83BC709A%40callow.im?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAPA_S1b9Q7q%3DYZV1Ls8QNek35pDLQYDSswwNgCua6P4FhL2kfQ%40mail.gmail.com.

Reply via email to