Creating and running a stub (testtool) from HA's Terminal

OMG it’s really complicated or I’m missing something here… from the HA’s terminal I would like to run a simple Python testtool like print('Hello, world!') stored in a file called test.py. Can I run this from terminal where “Hello, world!” is printed in the Terminal?