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.

0

1 Answer 1

8

Short and simple Answer.

import os.path
os.path.isfile(fname)
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, Im not sure, how to handle command line argument in it. Please help me with command line arguments usage for file checking.
Thanks, Im not sure, how to handle command line argument in it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.