1) the following information applies to all implementations of python3 on all systems
2) on OpenVMS systems: directory definitions are wrapped with square brackets
3) the PVM (python virtual machine) used here is cpython-310 (an implementation of python 3.10.0 written in C)
4) imported libraries are always case sensitive
5) file extensions:
py (python source code)
pyc (python compiled)
edit: 2023-08-20
execute this DCL command | python hello_world_loader.py | start |
"import hello_world" looks for source file | hello_world.py | |
look at timestamp of file | hello_world.py | |
look for subfolder | [.__pycache__] | |
look for bytecode file | [.__pycache__]hello_world.cpython-310.pyc | |
compare timestamps if pyc is after py then run |
[.__pycache__]hello_world.cpython-310.pyc |
stop 1 |
compile py script then saves pyc | [.__pycache__]hello_world.cpython-310.pyc (could result in the creation of a sub folder) |
|
python executes | [.__pycache__]hello_world.cpython-310.pyc | stop 2 |
! first we need a foreign command $ rfmstmlf :== convert/fdl="""record; format stream_lf""" ! now we use the foreign command to convert the file to stream_lf $ rfmstmlf targetfile.txt
# ====================================================== # title : hello_world_loader.py # platform: OpenVMS-8.4-1H1 I64 (Itanium) # author : Neil Rieck
# created : 2023-08-08 # usage : python hello_world_loader.py # ====================================================== import hello_world hello_world.main()
# ====================================================== # title : hello_world.py # platform: OpenVMS-8.4-1H1 I64 (Itanium) # author : Neil Rieck
# created : 2023-08-08 # usage : # 1) python hello_world.py (compiles to memory every time) # 2) import then run from another script # note: see 'hello_world_loader.py' in this folder # ====================================================== def main(): print("hello world") if __name__ == "__main__": main()