Reputation: 161
Python Program:
import sys
print(len(sys.argv))
Command Line:
Without '>' Operator
>>> python sample.py 1 2 3
Output:
4
With '>' Operator
>>> python sample.py > 1 2
Output:
Not Showing Anything
How to make it as a Command Line Argument, Without Using Any Quotes. I need it because I am implementing Cat command with python.
Upvotes: 1
Views: 63
Reputation: 2582
Since by using >
, you can print your Terminal or CMD output to a file, u need to use it with double quotations around
You need to use it like: python sample.py ">" 1 2
Upvotes: 2