顯示具有 python 標籤的文章。 顯示所有文章
顯示具有 python 標籤的文章。 顯示所有文章

2022年11月10日 星期四

[光想不作狂想曲] 狂想目標:wpwf

 [光想不作狂想曲]

狂想目標:wpwf (where python where forth),熟練 chipforth assembly code

[考慮點]:

python is open source,

build-in in linux,and easy get at mac,windows,etc

算是主流 interpreter,可吸引學生作專題寫報告,然後誤入符途,而終生不悔。

[回顧]:

想想入符半個甲子,除了用forth寫了一個 華容道的人機界面,和用forth 寫了一個 nec 4bit cpu simulator,就是玩玩meta 最佳化,追新系統的forth(dos->win->linux).也買過 rtx2000的,和 mpu f21 cpu 的kit board,除了跑跑 benchmark,試一試機車超跑,還真的沒用forth 幹過正事。


[緣起]:剛才看到網路上有人寫了 小hack/discompile/python

看了 opcode.h 似乎沒用完,夠塞 32+2個指令,這+2可能是 >forth 和 >python

這32個指令,可以塞 chipforth的指令集 如mup21,或 greenArray F18A

可能還需堆叠 to tuple 或 array 的資料交換機制。

https://blog.techbridge.cc/2017/12/01/pycon-2017-huan-le-xue-python-wei-yuan-zu-ma-byte-code/

又查了opcode

https://github.com/enthought/Python-2.7.3/blob/master/Include/opcode.h


[尾聲]:狂想永遠在實現前發生,雖然只會被厝邊頭尾,親朋好友,唸說 光說不作。


2021年11月11日 星期四

dump Unicode table , using python

def  dump_uni(start,end):
    for i in range(start,end):
if (  (i % 16) == 0):
            print
print unichr(i),

>>> dump_uni(0x23e0,0x25ff)

2021年5月4日 星期二

Markdown to html python commandline transfer tool

sudo apt update
sudo apt install python-pip
# cd to your workspace directory , below will lay down git folder from github

git clone https://github.com/Python-Markdown/markdown.git
cd markdown
pip install markdown

python -m markdown --help
echo "Some **Markdown** text." | python -m markdown > output.html
python -m markdown input_file.txt > output2.html

食用油

豆大芥小 加熱均 又非橄㰖 造假多 油麻菜籽 螻蟻命 自求多福 身安康 目前 我推 芥花油,較耐高溫. 從成份上來看 橄㰖>芥花>大豆 . 從CP/造假上來看 又不推 高價 橄㰖了, 可能 摻其它大豆等油/加色素等, 最近新聞 數千公頓大豆 不知所踪, 合理推測, 是...