Python Forum
Script File Failure-Path Error?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script File Failure-Path Error?
#5
(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 line C:\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.
Reply


Messages In This Thread
Script File Failure-Path Error? - by jerryf - Nov-27-2022, 04:02 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 05:08 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-27-2022, 08:19 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 08:26 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-27-2022, 08:54 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 09:14 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-27-2022, 11:00 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 11:51 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-28-2022, 10:09 AM
RE: Script File Failure-Path Error? - by jerryf - Nov-28-2022, 10:33 AM
RE: Script File Failure-Path Error? - by snippsat - Nov-28-2022, 07:15 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-29-2022, 02:45 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-29-2022, 07:04 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-30-2022, 09:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Failure to run source command middlestudent 2 765 Sep-22-2023, 01:21 PM
Last Post: buran
  File path by adding various variables Mishal0488 2 1,127 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  Dickey Fuller failure Led_Zeppelin 4 2,720 Sep-15-2022, 09:07 PM
Last Post: Led_Zeppelin
  Script Path tfernandes 8 2,361 Jul-07-2022, 09:48 PM
Last Post: tfernandes
  Simple Python script, path not defined dubinaone 3 2,765 Nov-06-2021, 07:36 PM
Last Post: snippsat
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,264 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  Assert failure jtcostel 1 1,676 Sep-03-2021, 05:28 PM
Last Post: buran
  Subprocess.Popen() not working when reading file path from csv file herwin 13 15,513 May-07-2021, 03:26 PM
Last Post: herwin
  Add file to sys.path permanently hcccs 5 8,644 Jan-31-2021, 11:26 AM
Last Post: hcccs
  Web Form to Python Script to Text File to zip file to web wfsteadman 1 2,187 Aug-09-2020, 02:12 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020