2

I want to give input as

%>Python_script_name listed_files

How to check if exist as file or it is some input argument.

<listed file can also be in path /govr/rest/listed_files >

Please share the small script, by which I can check if command line argument is valid file or it is a simple variable to be processed.

Just to summarize, I need to process my script so as to take or a single argument at command line.

Please help.

Thanks in advance.

Matt
  • 14,906
  • 27
  • 99
  • 149

1 Answers1

8

Short and simple Answer.

import os.path
os.path.isfile(fname)
Modzilla
  • 96
  • 2