Nov-27-2022, 08:54 PM
(Nov-27-2022, 08:26 PM)snippsat Wrote: Read my post again you are not doing what i post.
Again you most use whole file name when you run it from command lineC:\Users\jerry>python hello_world.py
Hello snipsat and thanks for your patience and 2 replies. My second post was just a revamp of my first one but using the forums BBCode conventions.
You are quite right that if I use the correct .py extension from the directory containing the script then it executes correctly (see below), so many thanks for that correction.
C:\python311\my_python_files>python hello_world.py
Output:Hello World
However, I am still puzzled by how the interpreter interacts with Windows environment since any attempt to execute the script using the cmd line from any other directory results in failure, even though the Path and PYTHONPATH all include the sub-directory containing the script.