Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows paths issue
#1
Using Python 3.7 on Windows 10 pro, I ran to the strange thing:
Path to vlc.exe on my PC is: C:\Program Files\VideoLAN\VLC\vlc.exe. In my script, I've defined it as: fullpath = "\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\""
The strange thing is that when I run: subprocess.Popen(fullpath, stdout=None, stderr=None, stdin=None, close_fds=True), that works correctly, but when I run the:
os.system("taskkill /f /im " + fullpath) it fails with: ERROR: Invalid query. When I tested if the file exist with os.path.exists(fullpath) it returned False

I googled around and according to what I found, I think I defined path correctly, so I don't understand why it works with the subprocces.popen and not in other cases? BTW: I also replaced the double backslashes with single forward slashes but the issue remained the same
Reply


Messages In This Thread
Windows paths issue - by otalado - May-29-2022, 03:37 AM
RE: Windows paths issue - by Gribouillis - May-29-2022, 07:22 AM
RE: Windows paths issue - by ibreeden - May-29-2022, 07:53 AM
RE: Windows paths issue - by snippsat - May-29-2022, 09:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pdf2image, poppler and paths jehoshua 18 15,715 Jun-14-2022, 06:38 AM
Last Post: jehoshua
  automatically get absolute paths oclmedyb 1 2,199 Mar-11-2021, 04:31 PM
Last Post: deanhystad
  chkFile with absolute paths JarredAwesome 7 3,122 Sep-21-2020, 03:51 AM
Last Post: bowlofred
  Paths millpond 12 5,427 Jul-30-2020, 01:16 PM
Last Post: snippsat
  Problems with windows paths delphinis 6 5,466 Jul-21-2020, 06:11 PM
Last Post: Gribouillis
  Shortest paths to win snake and ladder sandaab 5 4,383 Jun-30-2019, 03:20 PM
Last Post: sandaab
  How to handle paths with spaces in the name? zBernie 1 6,857 Nov-22-2018, 04:04 AM
Last Post: ichabod801
  Question: Paths and writing to a file mwmaw 6 6,663 Dec-20-2016, 03:44 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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