0

I am getting FileNotFoundError: [WinError 2] The system cannot find the file specified

from subprocess import check_output
out = check_output([r'dir',r'C:\Users\Lenovo\Downloads\WS*'])

Directory of C:\Users\Lenovo\Downloads

04-02-2014  20:59        11,682,838 WS BPEL 2.pdf
09-04-2015  04:22         7,758,832 WS-BPEL 2.0 Beginners Guide.epub
10-04-2015  20:33        19,605,151 WS-BPEL 2.0 Beginners Guide. Juric.pdf
16-08-2015  18:58    <DIR>          WSDL
               3 File(s)     39,046,821 bytes
               1 Dir(s)  243,993,673,728 bytes free

What am i doing wrong here

jhon.smith
  • 1,963
  • 6
  • 30
  • 56

1 Answers1

0

And if You write full, correct name in Your path instead of wildcard? still not working, have You tried? If still want to use it look at this answer: Python subprocess wildcard usage

Community
  • 1
  • 1
Drako
  • 773
  • 10
  • 22
  • Thanks for the answer its an enlightenment for me :) – jhon.smith Apr 14 '16 at 13:07
  • Sorry, I was not clear enough but what I mean is if it does not work only with wildcard or at all? That info makes difference in looking for solution :) and by the wildcard usage says exactly You to use shell=True :), but before using that answer has to be sure it works at all :) – Drako Apr 14 '16 at 13:35