venkat
venkat

Reputation: 161

'>' is not recognising as a command line Argument ? How to Pass this as a command Line Argument?

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

Answers (1)

DarkSuniuM
DarkSuniuM

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

Related Questions