Peforth

Latest version: v1.31

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

1.14

[x] 所有 run 法不帶 selftest 跑一遍,準備要 release 的版本:
[x] 改 %USERPROFILE%\Documents\GitHub\peforth\quit.f
' <selftest> :: enabled=False
Run setup.bat 做出取消 selftest 的 wheel
[x] pip uninstall peforth
[x] pip install peforth-xxxx.whl <== 注意!用剛做好的 wheel 否則會上網抓。
[x] 1. python -i -m peforth [x] no-selftest .s words exit
[x] 2. python -i -m peforth version drop
[x] 3. python import peforth
[x] selftest peforth.ok() .s words <--- no parent
[x] 1234 bye check echo %errorlevel%
[x] 4. jupyter notebook --> .s cd help bye .s cd help exit
[x] 5. repeat 以上 in ubuntu
--> copy the wheel to WSL ubuntu
--> use virtualenv is fine
[/] 考慮 README.rst 改良
[/] 若有改過 README.rst 則 wheel 就要重做
--> quit.f selftest=False --> 重來
[x] 所有 run 法帶 selftest:
[x] 改 %USERPROFILE%\Documents\GitHub\peforth\quit.f
' <selftest> :: enabled=True
Run setup.bat 更新本地版本以供測試
[x] 1. python -i -m peforth [x] with-selftest .s words exit bye
[x] 2. ipython -i -m peforth .' Hello World!!' cr bye
[x] 3. ipython import peforth .s words
[x] selftest peforth.ok() .s words <--- w/parent
[x] 1234 bye check echo %errorlevel%
[x] 4. jupyter notebook --> .s cd help bye .s cd help exit
[x] 考慮 README.rst 改良
[x] 若有改過 README.rst 則 wheel 就要重做
--> quit.f selftest=False --> 重來
[x] version 改成 1.15 (必須跳過 1.10 會變成 1.1)
[x] 直接用測過的 wheel update Pypi
[x] Make a master release up to GitHub --> 用 GitHub Windows 很簡單。

[x] WSL Ubuntu virtualenv weired experience
when pip install peforth in a virtualenv --> permission denied
--> so I use sudo and this will success but peforth will be installed
to global instead of the virtualenv! see https://stackoverflow.com/questions/14665330/pip-requirement-already-satisfied
--> The reason why permission denied was peforth-1.14-py3-none-any.whl which
was copied by windows and it needs chmod 777
\ see the correct example below:
(DeepSpeech) hcchen560031ENB667:~/GitHub/DeepSpeech$ chmod 777 peforth-1.14-py3-none-any.whl
(DeepSpeech) hcchen560031ENB667:~/GitHub/DeepSpeech$ pip install peforth-1.14-py3-none-any.whl
Processing ./peforth-1.14-py3-none-any.whl
Installing collected packages: peforth
Successfully installed peforth-1.14
(DeepSpeech) hcchen560031ENB667:~/GitHub/DeepSpeech$
[x] peforth.vm.things 的 peforth.things alias
14:59 2018/03/11 讓 vm.execute() vm.dictate() peforth.ok() 都傳回 vm 以便 support function cascade
19:22 2018/03/11 除了以上,連 stack, push, words, ... etc 都加上去了。
[x] %f magic command 暫無 auto-load, 必須 import peforth 才有 --> 解決了,雖然這樣也好。
"c:\Users\hcche\OneDrive\文件\Jupyter Notebooks\Creating an IPython extension with custom magic commands.ipynb"
討論複製過來如下:
[x] 如上述加上 c.InteractiveShellApp.extensions = ["c:\\Users\\hcche\\Downloads\\csvmagic.py"]
之後,無效。參考
[stackoverflow](https://stackoverflow.com/questions/27483637/auto-reload-extension-not-reloading-on-change)
學到用 '%load_ext c:\\Users\\hcche\\Downloads\\csvmagic.py' 在 jupyter notebook 或 ipython 中試試看 . . .
果然是 path 寫法的問題。照以上範例, csvmagic.py 位在 current directory 直接 '%load_ext csvmagic'
就可以了。如果不在 crrent directory 那就是要 importable 則手動放到 site-packages 去亦可,討論如下。
[x] 又或者必須是個 -m 搆得著的 module? 對了!上述的 importable 就是這個意思。--> 手動放進 site-packages (檔名改成 __init__.py) 就 importable 了,試試看 --> 成功!但是必須跑過 '%load_ext csvmagic' 之後才有 %%csv 不會自動 load。
[x] 而且 import csvmagic 也無效;然而經過以下正確安排之後 import peforth 有效,不知何故?
[x] 如何自動 load 應該跟 peforth 的 install 方式類似,這表示 csvmagic.py 所做的工作要由 `GitHub\peforth\peforthkernel.py` 來完成 (錯!要由 peforth 的 `__init__.py` 來負責)。其中 peforth %f 具有 line magic 與 cell magic 雙重腳色,該怎麼寫?看這裡:http://ipython.readthedocs.io/en/stable/config/custommagics.html
from IPython.core.magic import (register_line_magic, register_cell_magic)
register_line_magic
def f(line):
peforth.vm.dictate(line)

register_cell_magic
def f(line, cell):
peforth.vm.dictate(cell)

from IPython.core.magic import register_line_cell_magic
register_line_cell_magic
def f(line, cell=None):
if cell is None:
peforth.vm.dictate(line)
else:
peforth.vm.dictate(cell)

def load_ipython_extension(ipython):
ipython.register_magic_function(f, 'line_cell')
see http://ipython.readthedocs.io/en/stable/api/generated/IPython.core.interactiveshell.html?highlight=register_magic_function

[x] (錯!) 放進 GitHub\peforth\peforthkernel.py
[x] (錯!) copy 到 c:\Users\hcche\AppData\Roaming\jupyter\kernels\peforth\kernel.json 所指到的位置:"c:\\Users\\hcche\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\peforth\\peforthkernel.py"
[x] 重新啟動 jupyter notebook --> 結果無效, 這表示上面這段 code 沒有被執行到。可能放在 GitHub\peforth\peforthkernel.py 不對(確定不對),也可能另有某個 .json 要指對地方。看 document 吧! --> 已知!c.InteractiveShellApp.extensions = ['peforth'] 就這行,所以上面這段要放在 peforth 的 __init__.py 才對 (對了)--> 再試試看 ... 還是無效,必須 import peforth 才行。目前這樣可以滿意了。
[x] 我猜是 c.InteractiveShellApp.extensions = ['csvmagic','peforth'] 所在的
profile_default\ipython_config.py 整個都無效之故。先前嘗試 "28 Jupyter
Notebook tips, tricks and shortcuts" 該檔的另一個設定也是無效。從 path 裡
有個 /test/ 看來,可能不是正確的檔案。--> 由 %f get_ipython :> ().ipython_dir
. cr 得知正確的位置是:`C:\Users\hcche\.ipython` 才對,也就是
`C:\Users\hcche\.ipython\profile_default\ipython_config.py` --> 試試看,
有沒有自動 load_ext . . . 有了!剛改好 `profile_default\ipython_config.py`
就馬上對新開的 jupyter notebook 有效。
[x] ipython 的 magic initialization in __init__.py 要防呆,避免從 python (none ipython)
執行時出問題。判斷有沒有 ipython 的方法要看在哪裡判斷的, peforth __init__.py 裡
好像太早,結果這兩個方法都 always false 而無效,不能自動 load_ext :
if 'get_ipython' in globals():
if '__IPYTHON__' in dir(__builtins__):
我看就算了,需要先 import peforth 有它的好處,例如 greeting 會出現在 import 的時候。
[x] 從 jupyter notebook 裡面 debug peforth 的 __init__.py 很方便!用 pdb.set_trace()
設個斷點在 ipython 判斷式前,查看以上兩個式子 --> 在當時都是 false !! 但我找到
這個可以:
'__IPYTHON__' in __builtins__.keys()
B i n g o ! ! 果然成功了,我發現 __builtins__ 的定義再那之後會變,而
__builtin__ 在那時甚至都還不存在。

1.13

[x] 所有 run 法不帶 selftest 跑一遍,準備要 release 的版本:
[x] 改 %USERPROFILE%\Documents\GitHub\peforth\quit.f
' <selftest> :: enabled=False
Run setup.bat 做出取消 selftest 的 wheel
[x] pip uninstall peforth
[x] pip install peforth-xxxx.whl <== 注意!用剛做好的 wheel 否則會上網抓。
[x] 1. python -i -m peforth [/] no-selftest .s words exit
[x] 2. python -i -m peforth version drop
[x] 3. python import peforth
[x] selftest peforth.ok() .s words <--- no parent
[x] 1234 bye check echo %errorlevel%
[x] 4. jupyter notebook --> .s cd help bye .s cd help exit
[x] 考慮 README.rst 改良
[x] 若有改過 README.rst 則 wheel 就要重做
--> quit.f selftest=False --> 重來
[x] 所有 run 法帶 selftest:
[x] 改 %USERPROFILE%\Documents\GitHub\peforth\quit.f
' <selftest> :: enabled=True
Run setup.bat 更新本地版本以供測試
[x] 1. python -i -m peforth [/] with-selftest .s words exit bye
[x] 2. ipython -i -m peforth .' Hello World!!' cr bye
[x] 3. ipython import peforth .s words
[x] selftest peforth.ok() .s words <--- w/parent
[x] 1234 bye check echo %errorlevel%
[x] 4. jupyter notebook --> .s cd help bye .s cd help exit
[x] 考慮 README.rst 改良
[x] 若有改過 README.rst 則 wheel 就要重做
--> quit.f selftest=False --> 重來
[x] version 改成 1.14 (必須跳過 1.10 會變成 1.1)
[x] Make a master release up to GitHub --> 用 GitHub Windows 很簡單。
[x] 讓 jupyter feature peforth --> 已經加進 jupyter 的 kernel list:
https://github.com/jupyter/jupyter/wiki/Jupyter-kernels


[/] Like harry_port that brings all wanted variables to projectk
How to make it easier?
[/] Study when deep in a certain module, how peforth find and bring in
specified variables?
1. debug the toy.. keras exercise, breakpoint deep in a keras module
2. instead of using the trick of loc={**locals(),**{'foo':foo,'bar':bar}}
try to find foo,bar actual parent
3. access volatile variables out of their scope may not be a good idea
but being able to access them at a peforth breakpoint is necessary.

tensor_shape is imported in C:\Users\hcche\AppData\Local\Programs\Python\Python36\Lib\site-packages\tensorflow\python\keras\_impl\keras\layers\wrappers.py

char input_shape <text> \ local variable
locals :> ['{0}'] constant {0}
__main__ :: peforth.projectk.{0}=v('{0}')
</text> :> format(pop()) dictate

char tf <text> \ global variable
__main__ :> {0} constant {0}
__main__ :: peforth.projectk.{0}=v('{0}')
</text> :> format(pop()) dictate

* 1. char foobar module ( module )
2. py: setattr(sys.modules['foobar'].projectk,'foobar',v('foobar')) \ add to peforth

* 1. import numpy constant np // ( -- numpy ) module object, method 1
py> sys.modules['numpy'] constant np // ( -- numpy ) method 2
__main__ :> np constant np // ( -- numpy ) method 3
2. np __main__ :: peforth.projectk.np=pop(1) \ peforth global
np __main__ :: np=pop(1) \ __main__ global, see 'help __main__'
* 3. py: setattr(sys.modules['peforth'].projectk,'np',v('np')) \ alt method

char child_input_shape <text> \ local variable
locals :> ['{0}'] constant {0}
__main__ :: peforth.projectk.{0}=v('{0}')
</text> :> format(pop()) dictate

\ make librosa a global in peforth
char librosa py> tick(tos()) execute py: globals()[pop()]=pop()

\ even simpler way
import librosa constant librosa char librosa librosa py: globals()[pop()]=pop()

char input_shape <text> \ local variable
locals :> ['{0}'] constant {0}
__main__ :: peforth.projectk.{0}=v('{0}')
</text> :> format(pop()) dictate

char tensor_shape <text> \ local variable
locals :> ['{0}'] constant {0}
__main__ :: peforth.projectk.{0}=v('{0}')
</text> :> format(pop()) dictate

char selfLayer <text> \ local variable
locals :> ['{0}'] constant {0}
__main__ :: peforth.projectk.{0}=v('{0}')
</text> :> format(pop()) dictate

import peforth [/] _debug_
peforth.ok(cmd='''
0 value Count
none value child_output_shape
exit
''')

try:
child_output_shape = child_output_shape.as_list()
except Exception as err:
peforth.ok('33> ',loc={**locals(),**{'tensor_shape':tensor_shape,'self.layer':self.layer,'err':err}})

locals :: pop('peforth') locals inport
tensor_shape :> TensorShape(v('input_shape')).as_list() constant input_shape2
tensor_shape :> TensorShape([v('input_shape2')[0]]+v('input_shape2')[2:])
constant child_input_shape
self.layer :> _compute_output_shape(v('child_input_shape')) tib. \ ==> (?, 2048) (<class 'tensorflow.python.framework.tensor_shape.TensorShape'>)
self.layer :> _compute_output_shape(v('child_input_shape')) tib. \ ==> (?, 2048) (<class 'tensorflow.python.framework.tensor_shape.TensorShape'>)
self.layer :> _compute_output_shape(v('child_input_shape')) tib. \ ==> None (<class 'NoneType'>)
self.layer :> _compute_output_shape(v('child_input_shape')) tib. \ ==> None (<class 'NoneType'>)

[x] jupyter notebook 裡無法 exit , 每次 exit 都會留下一個東西在 stack 裡,出不去。
load> exit
load> .s
0: <IPython.core.autocall.ZMQExitAutocall object at 0x0000020577BF5EF0> (<class 'IPython.core.autocall.ZMQExitAutocall'>)
load>
--> 用 .py 比較看看 --> 沒這問題。
--> 直接進去,直接出來看看 --> 馬上卡住了。
--> 簡化 the peforth cell, 比較結果 ... 在 locals inport 之後多出一個 exit
看起來還是原來的 exit 但多出來就是不對,而且 --- marker clean up 之後好了!
充分證明就是它。
--> 怎麼發生的?--> ipython case 下,當時的 locals() 就是有 exit quit 等一堆東西
正好 exit 撞上了,而 locals :> ['exit'] . cr --> <IPython.core.autocall.ZMQExitAutocall object at 0x000001DBB24B5EF0>
正是那個怪東西。
RI

[/] 最好 inport 能用挑的。程序如下:

load2> locals keys . cr
dict_keys(['__name__', '__doc__', '__package__', '__loader__', '__spec__', '__builtin__', '__builtins__', '_ih', '_oh', '_dh', 'In', 'Out', 'get_ipython', 'exit', 'quit', '_', '__', '___', '_i', '_ii', '_iii', '_i1', 'tf', '_i2', 'tflearn', '_i3', 'speech_data', '_i4', 'time', 'peforth', 'epoch_count', 'learning_rate', 'training_iters', 'batch_size', 'width', 'height', 'classes', '_i5', 'batch', 'word_batch', '_i6', 'net', 'model', 'x', '_i7'])
\ 從上表裡面挑要用的東西
<py> ['get_ipython', 'tflearn', 'speech_data', 'time', 'epoch_count',
'learning_rate', 'training_iters', 'batch_size', 'width', 'height',
'classes', 'batch', 'word_batch', 'net', 'model', 'x']
</pyV> ( [挑過的keys] )
\ 從 locals 裡面挑這些東西出來
<py> dict([(k,v) for k,v in v('locals').items() if k in tos()])
</pyV> nip ( {挑過的locals} )
\ 可以放心地 inport 成 peforth words 了
inport

[ ] python virtualenv http://docs.python-guide.org/en/latest/dev/virtualenvs/
解決的問題也是 FORTH 的問題,參考人家怎麼解的,可以想想怎麼沿用,看如何只 include 必要的東西。
[x] Ubuntu 的問題好像有解了,
--> Ubuntu 之下
OK site :> USER_BASE . cr 不存在!
/home/hcchen5600/.local
OK site :> USER_SITE . cr 不存在!
/home/hcchen5600/.local/lib/python3.6/site-packages
OK site :> PREFIXES . cr
['/usr', '/usr']
實際東西放在
site.PREFIXES[0] + /local/lib/site-packages/peforth/

--> windows
OK site :> USER_BASE . cr 不存在!
C:\Users\hcche\AppData\Roaming\Python
OK site :> USER_SITE . cr 不存在!
C:\Users\hcche\AppData\Roaming\Python\Python36\site-packages
OK site :> PREFIXES . cr
['C:\\Users\\hcche\\AppData\\Local\\Programs\\Python\\Python36', 'C:\\Users\\hcche\\AppData\\Local\\Programs\\Python\\Python36']
實際東西放在
site.PREFIXES[0] + /lib/site-packages/peforth/

--> Ubuntu virtualenv
>>> import site
>>> site.PREFIXES
['/home/hcchen5600/GitHub/DeepSpeech', '/home/hcchen5600/GitHub/DeepSpeech']
>>> site.USER_BASE
'/home/hcchen5600/.local'
>>> site.USER_SITE
'/home/hcchen5600/.local/lib/python3.6/site-packages'
實際東西放在
site.PREFIXES[0] + /lib/site-packages/peforth/
也就是
\rootfs\home\hcchen5600\GitHub\DeepSpeech\lib\site-packages\peforth\..

\ Windows 下可 normalize the path
照上面實施, windows 下變成
OK py> path . cr
C:\Users\hcche\AppData\Local\Programs\Python\Python36/lib/site-packages/peforth/
\ 這可以用 ntpath.normpath() 解決
OK import ntpath
OK constant ntpath
OK ntpath dir . cr
['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_get_bothseps', '_getfinalpathname', '_getfullpathname', '_getvolumepathname', 'abspath', 'altsep', 'basename', 'commonpath', 'commonprefix', 'curdir', 'defpath', 'devnull', 'dirname', 'exists', 'expanduser', 'expandvars', 'extsep', 'genericpath', 'getatime', 'getctime', 'getmtime', 'getsize', 'isabs', 'isdir', 'isfile', 'islink', 'ismount', 'join', 'lexists', 'normcase', 'normpath', 'os', 'pardir', 'pathsep', 'realpath', 'relpath', 'samefile', 'sameopenfile', 'samestat', 'sep', 'split', 'splitdrive', 'splitext', 'splitunc', 'stat', 'supports_unicode_filenames', 'sys']
OK ntpath :> normpath . cr
<function normpath at 0x000001C511337E18>
OK ntpath :> normpath py: help(pop())
Help on function normpath in module ntpath:

normpath(path)
Normalize path, eliminating double slashes, etc.

OK py> path ntpath :> normpath(pop()) . cr
C:\Users\hcche\AppData\Local\Programs\Python\Python36\lib\site-packages\peforth
OK
\ 或者檢查看是否 Windows
In [8]: sys.modules.get('nt') <--- None 就是沒有,就不是 windows
In [9]: sys.modules.get('sys')
Out[9]: <module 'sys' (built-in)>
In [10]:
\ 更好的方法, yeah! this is it.
-- ubuntu --
In [12]: os.name
Out[12]: 'posix'
-- windows --
OK os :> name . cr
nt
[/] 有了這個 solution 連 jupyter peforth kernel 的 install 都可以自動化了。
[x] Ubuntu 的問題應該已經解決了,要推廣 peforth 必須趕快 release

1.11

new words import, __main__, break_include, and improved *debug* and help

1.09

[x] 所有 run 法帶 selftest 跑一遍
[x] Run setup.bat 做出有 selftest 的 wheel
[x] pip uninstall peforth
[x] pip install peforth-xxxx.whl <== 注意!用剛做好的 wheel 否則會上網抓。
[x] 1. python -i -m peforth [/] selftest .s words exit
[x] 2. python -i -m peforth version drop
[x] 3. python import peforth
[x] selftest peforth.ok() .s words <--- no parent
[x] 1234 bye check echo %errorlevel%
[x] 所有 run 不帶 selftest 再跑一遍
[x] 注意!改的是 site-packages\peforth\quit.f 所以要
在 setup.bat 做 wheel 以前插入這個動作!!!!!
Run setup.bat 做出取消 selftest 的 wheel
[x] pip uninstall peforth
[x] pip install peforth-xxxx.whl <== 注意!用剛做好的 wheel 否則會上網抓。
[x] 1. python -i -m peforth [x] selftest .s words exit bye
[x] 2. python -i -m peforth .' Hello World!!' cr bye
[x] 3. python import peforth
[x] 考慮 README.rst 改良
[x] version 改成 1.11 (必須跳過 1.10 會變成 1.1)
[/] -indent 可以更聰明一點,目的讓 <text>...</text> 內部更自由。
當 </text> 所在行是 blank line 時,就用它的長度當作 -indent 的最小值,這
麼一來 <text> 之後就可以接著放東西。那它的 space 數比 </text> 之前小,就
會被「加長」到「最小值」。這樣更自由。

[x] exit stop 之外,還需要一個中止 including 的方法。或者是仔細定義 stop, exit
的差別或者合併。vm.exit 是給 ok() 看的,很明顯它用來回到 python interpreter
這已經有點頭痛了,因為 exit 同時也是給 inner loop 看的 instruction 跟 RET
等效。意思是,如果 exit 再有別的意思,恐怕連我自己都糊塗了。那只剩 stop 了,
stop 用來打斷 outer loop 也很明確。所以,需要新的 word ... break-include
因為 sinclude 是用 dictate 來處理 .f file 的,可能把 ntib 改一下就有 break-include
的效果了,試試看,把斷點斷在 xray.f 裡查看半路的 tib 含不含 tutrial 。。。
---> Bingo!!

: break-include ( -- ) // Break including .f file
py: vm.ntib=len(tib) ;
stop 就是 reset()
exit 在 comiling 時是 EXIT==RET; 否則就是 vm.exit=True 而已,把 ok() 停下來。
2020/06/03 10:34:10 該為 proeforth 寫了個 skip2 更有彈性。

[x] peforth 可以用來幫 .py import modules
py> os.getcwd() constant working-directory // ( -- "path" ) Tutorial home directory saved copy
\ my MNIST_data directory is there
cd c:\Users\hcche\Downloads
py:~ from tensorflow.examples.tutorials.mnist import input_data as mnist_data; push(mnist_data)
parent :: ['mnist_data']=pop(1) \ pop(1) 很傷腦筋, in-line 要還原成 python 才看得懂。

[x] *debug* 改寫, 不要用 pdb.set_trace() 了
不用 import 就使用 pdb 的方法
py: sys.modules['pdb'].set_trace()
: *debug* ( <prompt> -- ... ) // FORTH breakpoint
BL word ( prompt ) py: ok(pop(),cmd="cr") ;
/// How to invoke pdb:
/// py: sys.modules['pdb'].set_trace()
[x] now 11 *debug* >> 22 <== but 22 got skipped ! <----- problem
--> fixed
[x] *debug* can not be used in compiling mode (colon definition) yet
because the following prompt needs to read tib immediatedly
[x] Bug found,
OK help a
Word in phaseB <Word 'help'>: 'int' object has no attribute 'help'
help improved
[x] new word "import" works fine
[x] new word __main__ works fine
s" dos title " __main__ :> __file__ + CRLF + dictate drop
Note! 如果沒有 CRLF 則 dos 會抓到 dictate 之後去,連 drop 都當成 command line 的一部份

1.08

[x] 所有 run 法帶 selftest 跑一遍
[x] Run setup.bat 做出有 selftest 的 wheel
[x] pip uninstall peforth
[x] pip install peforth <==== 啊!不行,會上網抓。
pip install 剛做好的 wheel
[x] 1. python -i -m peforth [/] selftest .s words exit
[x] 2. python -i -m peforth version drop
[x] 3. python import peforth
[x] selftest peforth.ok() .s words <--- no parent
[x] 1234 bye check echo %errorlevel%
[x] 所有 run 不帶 selftest 再跑一遍
[x] Run setup.bat 做出取消 selftest 的 wheel <-- 注意!改的是 site-packages\peforth
[x] pip uninstall peforth
[x] pip install peforth <==== 啊!不行,會上網抓。
pip install 剛做好的 wheel
[x] 1. python -i -m peforth [/] selftest .s words exit bye
[x] 2. python -i -m peforth .' Hello World!!' cr bye
[x] 3. python import peforth
[x] 考慮 README.rst 改良

1.07

[x] 所有 run 法帶 selftest 跑一遍
[x] Run setup.bat 做出有 selftest 的 wheel
[x] pip uninstall peforth
[x] pip install peforth <==== 啊!不行,會上網抓。
pip install 剛做好的 wheel
[x] 1. __main__.py [/] selfttest [/] greeting [/] exit [/] bye
[x] 2. python __main__.py version drop [/] .s words [/] exit [/] bye
[x] 3. python -i __main__.py [/] selfttest [/] greeting [/] exit [/] bye
[x] 4. python -i __main__.py version drop [/] .s [/] exit [/] bye
[x] 5. python -i -m peforth [/] selftest .s words exit
[x] 6. python -i -m peforth version drop
[x] 7. python import peforth
[/] selftest peforth.ok() .s words <--- no parent
[/] 1234 bye check echo %errorlevel%
[x] 所有 run 不帶 selftest 再跑一遍
[x] Run setup.bat 做出取消 selftest 的 wheel
[x] pip uninstall peforth
[x] pip install peforth <==== 啊!不行,會上網抓。
pip install 剛做好的 wheel
[x] 1. __main__.py [/] selfttest [/] greeting [/] exit [/] bye
[x] 2. python -i -m peforth [/] selftest .s words exit bye
[x] 3. python -i -m peforth .' Hello World!!' cr bye
[x] 4. python import peforth
[x] 考慮 README.rst 改良
--> GitHub 版的先弄好
[x] hello world
Ynote: 草稿 peforth wiki article hello world _wiki_
[x] README.md --> README.rst by http://rst.ninjs.org
[x] These words should be moved into selftest section
'description', 'expected_rstack', 'expected_stack', 'test-result',
'[all-pass]', '***', 'all-pass', '[r', 'r]', '[d', 'd]']
[x] while display-off dispaly-on should be moved out!
[x] a new word to include python file directly -- pyclude
supports commands after __peforth__ comment by simply removing
all __peforth__
Also comment out "from __future__ import print_function" lines

1. read the file
2. find all __peforth__ replace with null
3. find "from __future__ import print_function" comment it out.
4. -indent indent
5. add <py> and </py>
6. tib.insert the string

: pyclude ( <pathname.py> -- ... ) // Run the .py file in a <PY>..</PY> space
CR word readTextFile py> re.sub("__peforth__","",pop())
py> re.sub(r"(from\s+__future__\s+import\s+print_function)",r"\1",pop())
-indent indent <py> " <p" + "y>\n" + pop() + "\n </p" + "y>\n" </pyV>
tib.insert ;
/// Auto-remove all __peforth__ marks so we can add debug
/// statements what are only visible when debugging.
/// Auto comment out "from __future__ import print_function"
/// that is not allowed when in a <PY>..</PY> space.
[x] tib.insert is dictate now, an alias.

Page 2 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.