Using miniconda

Submitted by administrator on Sun, 2022年07月17日 - 1:47pm

Creating new python environment

With venv you cannot install a different python version. With miniconda you can.

conda create --name cj9
conda info --envs
conda activate cj9

Installing latest python version

#conda install python=3.10 # gives 3.10.4
#conda install python=3.10.5 # not found
conda install --channel conda-forge python==3.10.5

Channel conda forge provides latest packages

Simple HTTP(S?) server serving WebASM content

Submitted by clemens on Wed, 2021年02月17日 - 1:42pm

!!! WIP !!! I was surprised that running python3 -m http.server could serve WebASM.

But what about HTTPS? According to https://blog.anvileight.com/posts/simple-python-http-server/ this could be possible using

Simple echo server

Submitted by clemens on Mon, 2021年02月08日 - 4:57pm
#!/usr/bin/env python
# FILE: server.py
import socket
HOST = ''
PORT = 3000
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 s.bind((HOST, PORT))
 s.listen(1)
 conn, addr = s.accept()
 with conn:
 print('Connected by', addr)
 while True:
 data = conn.recv(1024)
 if data == b'\n':
 break
 conn.sendall(data)

then

python server.py

and

netcat localhost 3000

to test against

AltStyle によって変換されたページ (->オリジナル) /