Notice how "readable" the above routine is, without being encumbered by the all the statements comprising the functions that it calls.print("main.py program") #main.pb #proto file for main.py #By: D@CC #Date: 2023EMay17 requires("requires(s,'v==00')") requires("show(s,s,s,'v==00')") requires("showY(s,s,'v==00')") print("main.py proto-build-module") isShow=True strName="D@CC" show("strName",strName,isShow) print("end of main.py")
print("main.pb program") def requires(fcall,strMsg=""): if not strMsg=="": print("ErrRequest:",fcall,": ",strMsg) return strMsg #def end requires requires("requires(s,v)") ############################################ def show(objName,obj,isShow): if not isShow: return if not isinstance(objName,str): print("Error S01 in show Name is not a str:",objname) if isinstance(obj, str) or isinstance(obj,list) or isinstance(obj,int)or isinstance(obj,bool): print(objName,":",obj,":") else: typeObj=type(obj) print("Error S02 in show obj is not a str, list, int nor bool:",objName,"type:",typeObj,"value:",obj) return #def end show requires("show(s,s,B,v)") ############################################ requires("showY(s,s,B,v)","does NOT exist.") ############################################ print("main.py proto file") isShow=True strName="D@CC" show("strName",strName,isShow) print("end of main.py proto-build-module") #main.py (created by prepIX.py) # on 2023-05-16 T 01:22:57
This will produce the following output:>>>$ cd Desktop >>>$ python main.py
main.pb program ErrRequest: showY(s,s,B,v) : does NOT exist main.py proto file strName : D@CC : end of main.py proto-build-module
The source code for the "prepIX_WioT_v01o03_2023EMay17.py" (which is a time-stamped version of the prepIX.py) program can be found in Source 02. (Note that it has recently been renamed from "buildIX".) It will be downloaded from Source 02 as a ".txt" file. To use it, simply rename its extension to ".py" As the name implies, I will be using the prepIX.py program on the RPi to prepare the main.py programs for the Wio Terminal. I plan to use the IXc command (with the Bourne Shell shown below) to make it easy to run the prepIX.py program from the RPi Terminal command line./home/pi/Desktop/ prepIX_WioT_v01o03_2023EMay17.py main.pb /home/pi/Desktop/ix/ requires.py show.py
Some files (other than python e.g. shells such as "sh"), when run, are followed by a parameter or parameter string. In the above case, the parameter is "DCole". This parameter is allowed in IXc, so that IXc will function correctly for such non-python programs. In the case of python, the parameter "DCole" will be ignored by the python program.> $ IXc > ! -sh Environ_ix.sh?date=2022FJun21 DCole
HiPi Industries Inc. DBA PiShop.ca 9-190 Colonnade Rd. S. Ottawa ON, K2E 7J5 GST & HST# 796009322 Monday-Friday 9am-5pm EST 844-850-1100 Email: support@pishop.ca